Saturday, September 13, 2014

Reset SQL Server password




To reset the password, we need to set SQL server mode as Single use mode. To do that open a command prompt as an administrator

Type the following commands without the quotes (“ “)

  1. “net stop mssqlserver” and press enter. (mssqlserver is your server instance name)
  2. “net start mssqlserver /m” and press enter
  3. “sqlcmd” and press enter
  4. “CREATE LOGIN tempuser WITH PASSWORD = ‘Password123’ “ and press enter
  5. “GO” and press enter
  6. “sp_addsrvrolemember ‘tempuser’, ‘sysadmin’ “ and press enter
  7. “GO” and press enter
  8. “quit” and press enter
  9. “net stop mssqlserver” and press enter
  10. “net start mssqlserver” and press enter

Now you can login with "tempuser" account with the "Password123" as password and reset sa user account password.




No comments:

Post a Comment