SQL Server forgot to sign in account solution

Source: Internet
Author: User
Tags mssqlserver

"1" stops the SQL Server service and the SQL Server Agent service

"2" opens the command line as an administrator, starting the service in single-user mode.
(starting SQL Server in single-user mode enables any member of the computer's local Administrators group to connect to an instance of SQL Server as a member of the sysadmin fixed server role)
c:\windows\system32>net start mssqlserver/m
The SQL Server (MSSQLSERVER) service is starting.
The SQL Server (MSSQLSERVER) service has started successfully.


"3" Add login account and authorize. (or simply open SSMs login, modify or add a new account)
c:\windows\system32>sqlcmd
1> Create login kk with password= ' [email protected] '
2> Go
1> sp_addsrvrolemember ' kk ', ' sysadmin '
2> Go
1>


Restart SQL Server service when "4" is complete

SQL Server forgot to sign in account solution

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.