How to recover SA password on Microsoft SQL Server 2008 R2
2013-10-14 16:26
603 查看
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
…
Stop the SQL services
Edit the properties of the SQL Service
Change the startup parameters of the SQL service by adding a –m; in front of the existing parameters
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.
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 SQL Server Configuration ManagerStop the SQL services
Edit the properties of the SQL Service
Change the startup parameters of the SQL service by adding a –m; in front of the existing parameters
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.
相关文章推荐
- How to recover SA password on Microsoft SQL Server 2008 R2
- HOW TO CHECK FOR ACTIVE TRACE FLAGS ON MICROSOFT SQL SERVER
- How to Install SQL Server 2008 R2 (Express Edition)
- How to Install SQL Server 2008 R2 (Express Edition)
- Configuring HTTP Access to SQL Server 2008 Analysis Services on Microsoft Windows Server 2008
- How to install MOSS on Windows Server 2008 R2
- Configuring HTTP Access to SQL Server 2008 Analysis Services on Microsoft Windows Server 2008
- Microsoft SQL Server 2008 R2 XML处理 One solution is to increase the number of characters retrieved from the server for XML data.
- 安装sql server 2008 R2出现 创建usersettings/microsoft.sqlserver.configuration.landingpage.properties.setter
- How to activate Microsoft SQL Server 2012 evaluation
- Microsoft SQL SERVER 2008 R2 REPORT SERVICE 匿名登录
- Microsoft SQL Server 2008 R2学习(一)
- Microsoft SQL Server 2008 R2学习(二)
- How to enable sa user account in SQL Server 2005
- Microsoft SQL Server 2008 R2学习(二)
- Microsoft可能会在最近提供Microsoft SQL Server 2008 Release 2 (R2) 的下载
- How to enable javascript in windows server 2008 R2 enterprise
- Server 2008 R2: “You must use the Role Management Tool to install or configure Microsoft .NET”
- 【视频】Microsoft SQL Server 2008 R2 StreamInsight进阶
- How to recover deleted data from SQL Server 暴强