Provided you still have administrative access to the server itself, and the server is running in mixed mode (i.e. you can actually use local SQL logins), you can perform the steps below to reset the password. Note that this will result in some downtime as the SQL Server service will have to be restarted in single user mode.
First, determine the service name (can be done via services.msc): if it is the default instance, it's usually called MSSQLSERVER. If an instance name was specified, it is usually MSSQLSERVER$instance-name. E.g. if the instance is called MYSWEETAPP, the service name would be MSSQLSERVER$MYSWEETAPP.
Open an administrative (elevated) command prompt or Powershell:
net stop MSSQLSERVER net start MSSQLSERVER /f /mSQLCMD
sqlcmd.exe -E -S $sql_server_instance -Q "ALTER LOGIN sa WITH PASSWORD = 'some-strong-password';"
net stop MSSQLSERVER net start MSSQLSERVER
You should now be able to log in with the sa account and the new password.
« ‹ | December 2024 | › » | ||||
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |