Home » Blog » SQL Server » How to Reset the Password in SQL Server- Complete Guide

How to Reset the Password in SQL Server- Complete Guide

  author
Published By Karen Chard 
Rollins Duke
Approved By Rollins Duke
Published On May 10th, 2024
Reading Time 6 Min Read

How to Reset the Password in SQL Server

Summary- This article answers the user query about how to reset the password in SQL Server. Moreover, they want to know how to connect to the SQL server when SA is locked out. Therefore, we are mentioning the steps to perform this operation.

By going to the login’s properties and changing the password, or using an ALTER LOGIN Transact-SQL command with the new password, you can reset a password in SQL Server using SQL Server Management Studio. Moreover, we have an automated solution that executes the entire operation seamlessly.

How to Reset the SA Password in SQL Server? Possible Methods

We will explain in the following what to do if you lose your user password and SQL Server SA, so let’s get started and research each step in depth.

  • User login password reset without using SSMS
  • The SA password was reset using SQLCMD.
  • Change SQL Password via Plesk Interface
  • Reset SQL Password Using OSQL Utility

Tip: Read this blog if you want to know more information related to SQL Server Security Best Practices in depth

Technique 1: An Automated Solution to Recover Lost SQL Server Passwords

The RecoveryTools SQL Password Recovery Tool can simply retrieve any length of the password that you may have forgotten or misplaced. It may easily reset both the password for the user and the SA login account on your Windows computer without any Management Studio assistance. Additionally, understanding how to recover previously forgotten SQL Server passwords is safe and secure.

Steps to Retrieve your SQL Password

Follow these steps :

  1. Launch and configure the software on your computer.Download the software
  2. Use the browse button to upload the Master.MDF file at this point.upload MDF file
  3. After the scanning, all the account names appear on the screen.scan MDF files
  4. Choose the account users or SA whose password you want to recover by selecting its corresponding box. then press the button to reset your password.reset password
  5. Create a new password by selecting it from the password settings window to finish learning how to find the SQL server password.create SA password

Also Read: How to Fix SQL Server Error 5243? Quickly

Technique 2: How to Reset the SQL Password Using CMD

You can attempt to get the password manually if your Windows account is part of the local administrator group. If not, the CMD technique cannot be used. Here’s how to reset the SA password in SQL Server using a command line procedure.

  1. Launch the CMD command window as an administrator and type the following.
Osql -S SQL _Instance _Name -E
  1. Run the cmdlet on the command prompt after the aforementioned command has been completed.
EXEC sp_password NULL, ‘New _Password Login Name’

Technique 3: How to Reset SQL Server Password Using SQL Server Management Studio

If a user completely forgets their SQL password, they can use the Server Management Studio technique. Therefore, you must have SQL Server administration right to utilize this procedure. This technique can then be used to unlock the database account.

Learn “How to Reset the SA Password in SQL Server” using SSMS:

  1. To get the SQL server password, launch the SSMS and establish a connection with it.
  2. Use the security option first by going to the object explorer. Then, increase the number of logins.
    Choose the account whose password you wish to modify, then click on it. From the menu, choose properties.
  3. Update and verify the password under the login properties window. then press the OK button. to complete the instructions on locating the SQL server password.

Changing the Password for SQL Using the Plesk Interface

Indeed, Plesk functions similarly to a web dashboard. Managing files, domains, email accounts, databases, and server settings for your website is made easier with its assistance. With an approachable method for managing many facets of your web hosting environment, it’s made to simplify hosting for both technical and non-technical users.

  1. Navigate to Tools & Settings >> Database Service on the Plesk interface.
  2. To modify the password for a SQL server instance, click on its hostname from the database servers’ tools and settings box.
  3. Select Change Password.
  4. Next, create a new password and input it once more to make sure.
  5. Finally, click OK to save your edited file.

Reset SA Password Using OSQL Utility in SQL Server

The system administrator (SA) password can be reset using the OSQL utility in SQL Server by executing a particular query. Using Windows Authentication, this command establishes a connection to the server and modifies the user password to a new value you designate.

Guide on “ How to Reset the Password in SQL Server ” via OSQL:

Step 1 The command prompt should first be opened in administrator mode. List each SQL server instance after that.open the administrator mode

Note: The list of servers might result differently for each invocation due to the reasons.

Step 2 Therefore, if the command is not displaying over any servers, try executing it again.

Step 3 The command that you need to type to reset the password for an SQL server instance is now required. Hit the enter key after inputting the command.reset SA password

Use the remote server name or IP address of any Microsoft SQL Server instances that are being utilized remotely.user IP address

Notice: Change it to the new password.

Drawbacks of the Manual Solution

  • Increase in efficiency
  • Not scalable
  • Minimal Possibilities
  • No surety of desired results
  • Risk of errors
  • Lack of advanced features
  • A bad track record with the most number of failures
  • Possible Loss of Data

Finally, Say!

After going over every important detail here the user can easily acknowledge the techniques outlined in this article can be used to manually reset the SA password in SQL Server. On the other hand, if these manual techniques are difficult or time-consuming, then you can use an automated solution to learn how to reset the password in SQL Server.

To prevent losing them, it’s crucial to record crucial passwords in a safe location, such as system notes or a journal. Ultimately, for a seamless and safe password reset procedure, pick the approach that best meets your demands. I hope this article will provide you with how to use it.