Cannot log in with sysadmin login, the sa password is forgotten, the administrator is locked out

Source: Internet
Author: User
Tags builtin mssqlserver

As a DBA, your job is to keep your data secure and to meet your requirements, you remove the BUILTIN\Administrators group, disable the sa login, modify the server port, remove all logins for sysadmin permissions, and you can connect to the SQL Server instance, but without sysadmin permissions, how do I resolve this situation?

Then here's a way to log in single-user mode, then create a SQL Server login and give the sysadmin role.

  1. Open the cmd window and stop the SQL Server service, which shuts down the SQL Server Agent service at the same time:

  2. After closing, log in to the SQL Server server using single-user mode and enter the net start mssqlserver/f/t3608 (if the named instance: Net start Mssql$instancename):

  3. After successful startup, type the sqlcmd command, enter the SQL command-line interface, and then create the login [single] with T-SQL and give sysadmin permission:

  4. Then exit exits and closes the SQL Server service: net stop MSSQLSERVER.

  5. Then use the Configuration Management tool to open the SQL Server service, and then log on with single, you can see the login name of the single permission is sysadmin.

The above can successfully use the single login to recover SA, add builtin\adminnistrator groups and other operations!

Cannot log in with sysadmin login, the sa password is forgotten, the administrator is locked out

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.