I am logged in to a Windows 7 computer as an admin. I am trying to connect to SQL Server 2012 on the same machine. The SA account is locked out. When I try Windows Authentication, the login fails.
How do I log in now? Is there an external tool to unlock the SA user? I used an external tool to change the SA password. I don’t want to reinstall SQL Server.
Forgot the SA password or locked out of SA account? There may be situation where you are unable to access the SQL Server. In this article I will guide you how you regain the access to SQL Server instance.
How to Unlock SA Account and Reset SA Password?
The SA login is stored in the master database (master.mdf) file, but this file is inaccessible while SQL Server is running. To unlock SA account in SQL Server, you need to first stop your SQL Server instance, and then install SQL Server Password Changer on your local computer.
Start the SQL Server Password Changer program. Click on Open File button and select the master database (master.mdf) for your SQL Server instance. For example, in SQL Server 2008 Express the master.mdf file resides in the following location:
C:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA
After you’ve chosen the master database file, the program will analyze the file format and extract all database users from it. Choose the SA account and click on Change Password button. In the pop-up window, enter your desired new password and click OK.
The program will reset the SA password, and also enable / unlock the SA account when it is disabled or locked out. Start your SQL Server instance and you can then successfully connect to your SA account using your new password. Done!