How to reset a lost SA password on SQL Server

Suppose you've had SQL Server installed for a while and forgotten your SA password. Even long-time users can encounter this situation. This article from TipsMake will guide you on how to reset a lost SA password on SQL Server, including SQL Server 2014, 2012, and 2008.

SQL Server stores passwords as hashes in the master.mdf file. While resetting passwords on Windows 10 is relatively easy, it's different with SQL Server. If you have SQL Server Password Changer, you can easily reset a lost SA password. However, you cannot access the master.mdf file while SQL Server is running. Therefore, the first thing you need to do is stop the SQL Server service before resetting a lost SA password on SQL Server.

Picture 1 of How to reset a lost SA password on SQL Server

How to reset a lost SA password on SQL Server

Step 1: Stop the SQL Server service

On the Start Menu , click All Programs => Microsoft SQL Server => Configuration Tools and then click SQL Server Configuration Manager .

In the SQL Server Configuration Manager window, expand Services , and then click SQL Server.

Click OK . A red box on the icon next to the server name and on the toolbar indicates that the server has been successfully stopped.

Picture 2 of How to reset a lost SA password on SQL Server

Step 2: Reset SA password

Download and install the SQL Server Password Changer program .

After the installation is complete, open the program. Click the Open File button.

The program will prompt you to select the master.mdf file for SQL Server. By default, the master.mdf file is located in the C:Program FilesMicrosoft SQL ServerMSSQLData folder . If you don't know the folder location, you can type the master.mdf filename into the Windows Explorer search box and search through the system partitions.

Picture 3 of How to reset a lost SA password on SQL Server

After selecting the master.mdf file, the program will decrypt the file and display a list of database user accounts. Select your SA account and click the Change Password button. Set a new password and click OK to successfully reset your lost SA password on SQL Server.

The above is how to reset a lost SA password on SQL Server. After obtaining a new password, the next step is to access SQL Server Configuration Manager, open the SQL Server service again, and log in to the SA account using the new password.


To better understand SQL Server, readers can refer to the article " Comparing Oracle and SQL Server," which will provide a lot of useful knowledge.

« PREV POST
READ NEXT »