zoukankan      html  css  js  c++  java
  • How to recover SA password on Microsoft SQL Server 2008 R2

    How to recover SA password on Microsoft SQL Server 2008 R2

    When you are using MS SQL Server in mixed mode, it is very important that you know your SA password.

    There can be different reasons you lost the password

    • Person who installed the SQL Server knows the password but has left the building.
    • You did not write down the password in your password file
    • Password file is lost

    Steps to recover the SA password

    • Start the SQL services. These are now running in Single User Mode.
    • Start CMD on tthe SQL server
    • Start the SQLCMD command. Now you will see following screen

    • Now we create a new user. Enter following commands
      • CREATE LOGIN recovery WITH PASSWORD = ‘TopSecret_1′  (Remember SQL server has default strong password policy)
      • Go
        • Now this user is created
    • Now we grant the user a SYSADMIN roles using the same SQLCMD window.
      • sp_addsrvrolemember ‘recovery’, ‘sysadmin’
      • go
    • Stop the SQL service again
    • Change the SQL service properties back to the default settings

    • Start the SQL service again and use the new created login (recovery in my example)
    • Go via the security panel to the properties and change the password of the SA account.

    • Now write down the new SA password.
  • 相关阅读:
    Codeforces461E Appleman and a Game 做题心得
    关于贪心问题的处理
    各种容斥 笔记
    博弈论 笔记
    家庭多个路由器组网方案(AP+AC)
    21.06.06 训练赛
    Redirect...
    Web Api实践系列(三)route特性使用
    《Red Tuner》隐私政策
    前缀和-1915. 最美子字符串的数目
  • 原文地址:https://www.cnblogs.com/seapub/p/2746296.html
Copyright © 2011-2022 走看看