In the case of disabling Windows logon, the SA password has also been forgotten, how to handle

Source: Internet
Author: User
Tags mssql

Landlord before have encountered the case of disabling Windows login, sa password also forgot, and then online search a lot of processing methods, respectively tried, but are to solve, the following one after the landlord used method

Method One: According to the online search of a blog to the actual operation (the last operation to the sqlcmd-a times wrong)

Enable local accounts:
1. First look at whether the account of this computer has administrator privileges, if not added on.
2. In the Start menu, enter CMD in the search box, right-click to select Run as Administrator
3. At the command prompt, enter NET stop Mssqlservre to stop MSSQLServer running (you can use this method if you have stopped)
4. If 3 has a problem, prompt error, you can start-->sql Server--Configuration Tool-->SQL Server service--Open the SQL SERVER properties----high----
5. If the above is not a problem, then switch to the installation path, that is, binn under the Sqlservr.exe path

Then use CD C:\Program files\feiq\recv files\sqlserver2008\x86\setup\sql_engine_core_inst_msi\pfiles\sqlservr\mssql.x\ Mssql\Binn

Way to switch paths

6 again under this path with sqlservr-m Enter to execute the file

7. Re-login with Administrator account to open a window, enter sqlcmd-a
8. Enter the action command you want to change, here I need to add a native account
Such as:
Use master
GO
CREATE Login [account to be added, general format is machine name \ login account name] from WINDOWS with Default_database=[master]
GO
EXEC sp_addsrvrolemember @loginame =n ' machine name \ login account name ', @rolename =n ' sysadmin '
GO
In order to avoid errors, you can add an SQL account in case of a contingency, or you can enable the SA command
9. Restart the SQL Server service after the above operation is complete

Method Two: Forcibly modify the sa password, try to modify the tool with a password (the operation has not been modified successfully, not sure because the local database is too many wrong libraries or the tool itself is useless)

Link : http://share.weiyun.com/113cd67e693201c58ebe4b3552dd2650 (password: 1234)

In the case of disabling Windows logon, the SA password has also been forgotten, how to handle

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.