Forget SQL SERVER sa account password

Simply forgot your password, or have disabled it, then want to re-enable:

Test environment for SQL SERVER 2008, but 05 and r2 can also be used.
1, you can use

Null the sp_password, '123', 'sa' 
- sa password is set to "123"


2, can also be enabled, and then change the password

ALTER LOGIN sa ENABLE - Enable SA 
GO 

the ALTER LOGIN [SA] 
the WITH N'NewPassword PASSWORD = '- without providing the old password


Note: to change the time to look at the properties ---> Security ---> server authentication, this is not the 'SQL SERVER and windows authentication mode'
or you will have the following situation may arise:
the Login failed The for the User 'SA 'Cause: try to use SQL authentication login failures. Server configured to use only Windows authentication. [Client: <local machine>]  
Error: 18456, Severity: 14, State: 58.

This time the need to verify the body instead 'SQL SERVER and windows authentication mode' and then restart the service, and then modify the password on it.

If you do not verify modification over, you can look at the registry: HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ MSSQLServer \ MSSQLServer

Look at the value "LoginMode" is representative of a 1 or 2.1 windows body to verify, 2 represents the SQL SERVER and WINDOWS authentication mode.

as the picture shows: 


Below are links to various state false information described:
http://msdn.microsoft.com/zh-cn/library/cc645917.aspx

Guess you like

Origin www.cnblogs.com/dongfuan/p/11202527.html