Plesk

How to reset a password for the ‘sa’ user of a Microsoft SQL Server instance on a server with Plesk

Question

How to reset a password for the sa user of a Microsoft SQL Server instance?

Answer

To change a password for the sa user use any of these tools:

 

Using Plesk interface (if Microsoft SQL Server instance is registered in Plesk)

 

Follow these steps if Microsoft SQL Server instance is registered in Plesk.

  1. Log in to Plesk.

  2. Go to Tools & Settings > Database Servers.

  3. Click on a hostname of a Microsoft SQL Server instance, password for which you wish to change.

  4. Click Change Password.

  5. Specify a new password and click OK.

 

Using osql utility in a command prompt

 

  1. Connect to a server via RDP.

  2. Start a command prompt as an Administrator and list all Microsoft SQL Server instances:

    C:> OSQL -L

    Servers:
    WIN-TVSNFL1C14UMSSQLSERVER2016
    WIN-TVSNFL1C14UMSSQLSERVER2017

    Note: As stated by Microsoft, due to the nature of broadcasting on networks, osql may not receive a timely response from all servers. Therefore, the list of servers returned may vary for each invocation of this option. If the command does not display any server, try to execute it another time.

  3. In the command below, specify a Microsoft SQL Server instance for which you want to reset a password and replace ***** with your new password. Once done, run the command:

    C:> osql -S "WIN-TVSNFL1C14UMSSQLSERVER2017" -E -Q "exec sp_password NULL,'*****','sa'"

    • For a remote Microsoft SQL Server instance, use its remote server name or IP address:

      C:> osql -S "SERVERNAME or IP ADDRESSINSTANCE_NAME" -E -Q "exec sp_password NULL,'*****','sa'"

 

Using Microsoft SQL Management Studio

 

  1. Connect to a server via RDP.

  2. Download and install SQL Server Management Studio on your Windows Server.

  3. Once installed, start Microsoft SQL Management Studio. To do this, run the command below in a command prompt:

    C:> ssms.exe

  4. Select Microsoft SQL Server instance for which you want to reset a password from the drop-down list and connect using Windows Authentication.

  5. In the Object Explorer, expand Security > Logins > right-click on sa to open its Properties.

  6. In the Properties window, set a new password for sa and click OK to apply the changes.

    If Windows administrator does not have permissions to reset a sa user password, refer to the instructions from this Microsoft article: