Solution for SQL Server 2008 forgetting the sa password

Source: Internet
Author: User

SA and Windows Authentication cannot log on to SQL Server for some reason, and you can modify the SA password in exclusive mode
Stop the SQL Server service in Service Manager, then open the command line, go to the SQL Server installation directory, and enter Binn
Execute Command sqlservr.exe-m
Open a command-line window after startup to enter command sqlcmd
Execute command to make SA account available
ALTER LOGIN SA ENABLE;
GO
Modify the sa password (UNLOCK requires more than 2008 versions)
ALTER LOGIN sa with password= ' new password ' Unlock,check_policy=off,check_expiration=off;
GO
Create a new System account

CREATE LOGIN DBAdmin with PASSWORD = ' [email protected] '
Goexec sp_addsrvrolemember DBAdmin, sysadmin
GO
Enter quit after completion
Close all command-line windows
Start SQL Server service in Service Manager, you can log in with SA account and add a Windows account

Solution for SQL Server 2008 forgetting the sa password

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.