If, like me, you’ve lost/forgot the SQL instance account’s password of one your server, you should have a look on this post 😉
I was looking for a quick and efficient way to recover or reset the account password of one SQL Express 2005 instance.
Here’s how I did it.
Restart the SQL instance in maintenance mode
Open an RDP connection to you Windows server
If you’re not sure about the instance name, run the command below
Then open the Configuration Manager tool (in my case, it was under SQL Server 2005 -> Configuration).
Once you’ve the tool open, open the properties of the SQL instance you need to reset the password and select the advance tab.
Modify the Startup parameters by adding the string below at the end (make sure you no space betwen the last character and the string).
This option will set the SQL instance in maintenance mode (single user mode)
Then restart the SQL instance.
Reset the account password
Open a DOS prompt (run as Administrator) and run the commands below (don’t forget to change the password and accoutname)
C:\Windows\system32>osql -S SERVERNAME\SQLINSTANCE -E
1> EXEC sp_password NULL, 'newpassword', 'accountname'
Test the connection
Restart the instance in normal mode and try to connect with the account using the SQL Server Management Studio
It should work like a charm. Enjoy 😉