SQL Server 2008 workaround for forgetting sa password _mssql2008

Source: Internet
Author: User

I believe a lot of people are like a small series no matter what account number, if a long time does not forget the login password, like database SQL Server2008 also have the user name and login password, the following small series to share how to retrieve or modify the SQL Server2008 password

If you have server network Administrator admin privileges

1. Log in to the computer first with the Super Admin administrator account, then open the Library SQL Server2008 to the login interface, then select Windows Authentication (note: Must be a super Admin account Oh, otherwise you cannot log on with Windows authentication)

2, Login to find the Security menu, and then in the login to find the user you want to modify, here to "sa" account for example

3, double-click the sa Account pop-up Modify Password window, and then select "General" in the Password input box re-enter the password can be

4, if found still unable to log in the case, please return to the main interface in the left list to select the first item, and then click the right mouse button, select Properties

5. Find security in the dialog box that pops up, and then select SQL Server and Windows authentication in server authentication and login to audit to select failed logins only.

If the administrator account is mistakenly deleted, you can refer to the following method

Today, a friend asked the question, as shown in the topic, for a while really difficult to answer, did a number of experiments, and finally finished, the method is as follows, for your reference:

Problem Description: A friend's SQLSERVER2008 may not add the current account as an administrator at the time of installation, or later remove DOMAIN\Administrator from SQL Server's "login". Anyway, he is unable to use the Administrator account into the SQL Server, and the SA account password unfortunately was he forgot.

Operational key points: find ways to add new permissions to the account, use Sqlservr-m and sqlcmd

Operation Steps:
1. Stop the database service
2. Start in Single-user mode, do not know the students to search the Sqlservr.exe, look at this file in which directory, and then call the command line, plus-m parameter, namely SQLSERVR-M
3. Log in to SQL Server, personally like to use SQLCMD, execute the command: sqlcmd return
4. This is the time to come in, the following command to operate
C:\users\administrator>sqlcmd
1> Create login Anyang with password= ' admin@123 '
2> Go
1> sp_addsrvrolemember ' Anyang ', ' sysadmin '
2> Go
At this point, a database administrator account named Anyang is added to the system.

5. End sqlcmd and sqlservr-m windows, restart SQL Server service, log on with Anyang
6. In the following illustration, add the Administrator account for windows in "login" and grant sysadmin permissions.

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.