Unable to connect to SQL Server, the SQL Server SA Account When It’s Locked Out. Then What to do? If you are not able to access SQL server then you might have to face this error “Login failed for user ‘sa’ because the account is currently locked out”. You can take the help of this blog to fix this type of error. As it contains all the correct manual techniques to unlock Microsoft SQL Server User Accounts. Just follow us!!
First of all, you should know the reason behind this error so that you can easily understand it.
Reasons for “SQL Server account locked out” error-
The reason for locking the SA account after multiple failed login attempts is because the SQL Server login is configured to use password enforcement policy and account lockout is enabled after a number of failed login attempts.
Now, after knowing the reasons for its occurrence, move ahead to know the solutions to fix it.
How to Unlock SQL Server SA Account When It’s Locked Out?
There are various manual methods to Microsoft SQL server unlock SA account as given below:
Method 1: Unlocking the SA Account in Management Studio
If mixed-mode authentication is enabled in SQL Server, you can easily log in with Windows Authentication to SQL Server Management Studio and unlock any SQL Server user account. Follow the steps below:
- Initially, sign into SQL Server using Windows Authentication.
2. Then open the Security folder in Object Explorer>>open Logins folder. Press a right-click on SA account>> go to Properties.
3. Uncheck the box next to Login in the Login Properties window and hit OK.
Method 2: Unlock SQL Server Account Using Command Prompt
- Hit Win+R and type cmd in the dialogue box. Press enter. Then the Command Prompt will appear.
- Then type this command “Osql –S ComputerName –E command” and hit enter.
- After this, type command EXEC sp_password NULL, ‘NewPassword’, ‘sa’ and press enter.
- At last, type Go. Now, your password has changed, you can sign into your SQL Server by using the new password.
Method 3: Unlock Microsoft SQL Server User Accounts by Deleting Password Enforcement
- Make sure you are a member of the local admin group on the SQL server.
- Next, stop the service of SQL Server.
- Then through a command line, start SQL service in Single User Mode with the below command (-m defines Single User Mode):
net start mssqlserver\instance -m
4. Sign in to SQL Management Studio as a Local Administrator account.
5. Now, for a ‘sa’ account, you have a single connection where you have to uncheck the status of ‘Account Locked’.
6. Now, you will be able to log out of the SQL Management Studio.
These are the manual methods used to fix a SQL server account locked out error. Using the above methods, there may be a chance of data loss that leads to more errors as well. So, to avoid these complications, we’ve come up with a better solution.
Method 4: An Alternate Solution
There is another best option to Unlock Microsoft SQL Server User Accounts by using SQL Server Password Remover utility. With this tool, you can quickly reset the password of your choice if you have lost or forgot it. Using this utility, your data will remain intact and it is a secured tool.
We have mentioned the reasons for the “locked SA account” that you have to keep in mind. The manual and expert solution for accessing the SQL Server SA account is provided here. You can make a choice of any approach that best suits your situation.