Showing posts with label forgot sa password. Show all posts
Showing posts with label forgot sa password. Show all posts

Wednesday, May 7, 2014

How to Recover SA Password in Single-user Mode

Forgot your SA password and can't connect to SQL Server? How to login to SA account after locked out of SQL Server? Start SQL Server in single-user mode and you can reset SQL Server password easily. This hacking trick makes it possible to unlock SQL Server login without resetting the password of any existing account.

How to Recover SA Password in Single-user Mode
  1. Launch SQL Server Configuration Manager. Stop your SQL Server instance if it is running.
  2. Right-click on your SQL Server instance and select Properties.
    SQL Server Configuration Manager
  3. In SQL Server 2014 or 2012, click Startup Parameters tab. Enter –m and then click Add.
    SQL Server 2014/2012 Startup Parameters
    If you've installed SQL Server 2008 (R2) or an earlier version, click Advanced tab and add -m; before existing value in Startup Parameters box, without any spaces.
    SQL Server 2008/2005 Startup Parameters
  4. Save your changes and restart the SQL Server instance. This will start SQL Server in single-user mode.
  5. Open an elevated Command Prompt and use the SQLCMD command to connect to your SQL Server instance:
    SQLCMD –S .\SQLEXPRESS
    Replace SQLEXPRESS with the name of your SQL Server instance.
  6. Here we'll create a new login called "tom" and then add this account to the SA server role. Run this command:
    CREATE LOGIN tom WITH PASSWORD='P@ssword123'
    GO
    SP_ADDSRVROLEMEMBER tom,'SYSADMIN'
    GO
    Create New Login in SQL Server Single-user Mode
  7. Once you've successfully performed these steps, the next step is to stop your SQL Server instance. Remove the -m you've added in Startup Parameters.
  8. Start your SQL Server instance. Open the SQL Server Management Studio and you can login using the newly created "tom" account. You now have SA access to your SQL Server instance. You may now reset the SA password and take control of your SQL Server box.
However, if you can't access SQL Server in single-user mode or can't log on Windows as administrator, this method won't work. In that situation, you need to use the SQL Server Password Changer program which enables you to unlock / reset SQL Server SA password offline.

Tuesday, May 6, 2014

How to Recover SA Password on SQL Server 2012

How to recover lost SA password on a SQL Server 2012 Express instance? If you've forgotten the login password for SA account, you are probably in a panic. Fear not, for you can reset the password and once again have access to the powers of the SA account by using a SQL Server password recovery program.

SQL Server Password Changer could be used to reset forgotten SA password on SQL Server 2000, 2005, 2008 (R2), 2012 and 2014. This article provides step-by-step instructions on how to reset SQL Server 2012 password without having any sort of administrator rights to the SQL instance.

How to Recover SA Password on SQL Server 2012?


SQL Server account passwords are stored in Master Database (master.mdf). Before getting started, you need to shutdown your SQL Server instance via SQL Server Configuration Manager. So we can then access the master.mdf file and reset lost SQL Server 2012 password offline.
  1. Click here to download and install the SQL Server Password Changer program on your computer.
  2. Click the Open File button. Select the SQL Server 2012 master database file (master.mdf). Typically it is located in the folder: C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA.
    Select the SQL Server master database file
  3. The program will automatically decrypt the master database file and display all user accounts in your SQL Server. Select the SA account, click the Change Password button. Type a new password and click OK.
    SQL Server Password Recovery
  4. The program will replace the existing password with your new password, and also unlock your SA account if it's already locked out or disabled. Now start your SQL Server instance again and you can then log into the SA account using your new password.