How to Reset SQL Server sa password ?

694    Asked by AyushiKhatri in SQL Server , Asked on Apr 22, 2021

I need to recover my SQL Server sa password . The situation is: I don't know the SA password and Windows Authenticated user is no longer active user (disable user because the user has left job) so I can not log in using Windows authentication. Is there anyway to reset the sa password, Windows authentication and to log in to the database? Last option could be uninstall and install again. In this case data will be lost. Thanks in advance Here are the steps to reset sql server sa password



    Answered by Caroline Brown

    Here are the steps to reset sql server sa password

    • Open the SQL Server Configuration manager.
    • Go to SQL Server Services and Stop the SQL Server Instance.
    • Right click on SQL Server Instance and select the Properties option.
    • Go to Startup Parameters tab, type –m to Specify a startup parameter and click on Add.
    • Click on Apply and then OK.

    Here is another workaround:

    1. Run the SQL Server Management Studio as the system account. This can be done easily with the PsExec program. Download PsExec from Sysinternals website. Extract the PsExec.exe program and save it to a folder on your computer such as C:.
    2. Open an elevated Command Prompt and run the following command:
    3. C:PsExec.exe -s -i "C:Program Files (x86)Microsoft SQL ServerHToolBinnManagementStudioSsms.exe"
    4. It will start SQL Server Management Studio as the system account. You’ll see that the username is shown as "NT AUTHORITYSYSTEM". Simply choose the Windows Authentication mode and click on the Connect button.
    5. Once you connect, you can reset SA password with ease.
    6. If this also doesn't work, the last resort is try some third-party software such as SQL Server Password Changer, or reinstall your SQL Server.



    Your Answer

    Interviews

    Parent Categories