Use SQL Server to establish a login Windows account _mssql

Source: Internet
Author: User
At that moment, my heart beat to the throat.
Run the Build account command, ok!
Remote login, enter account number, password, ok! Finally went in again!
Xxxxxxxxxxxxxxxxxxx
I suddenly found that the database server can not log in.
Prompt account password expires. Press prompts to modify, submit, and said that I do not have permission to change the password!
CNM, this will harm me. This account belongs to administrators, the original default administrator was stopped by me. So this account number is the only access to the system.
Then I found the consequences more serious than I thought:
1, the hard drive to do a RAID5, so even to get the hard drive, may not be able to read the database file.
2, our database backup files only once a week, and backup files are placed on the same server
3, it is well known that MS SQL backups can only be backed up to this machine unless there is a disk that maps other machines. Of course, a U disk hanging on top, and then backup is also possible, but the room is hundreds of kilometers away from us.
My mood really fell to the freezing point.
......
Fortunately, there is no problem with the server, and I have the database Super Administrator sa account password, with the same LAN SQL can also connect the past.
The solution is as follows:
Using the SA to enter SQL SERVER2005, run the following command:
Open xp_cmdshell First:
--To allow advanced the options to be changed.
EXEC sp_configure ' show advanced options ', 1
Go
--To update the currently configured value for advanced options.
Reconfigure
Go
--to enable the feature.
EXEC sp_configure ' xp_cmdshell ', 1
Go
--To update the currently configured value of this feature.
Reconfigure
Go
Then build a Windows account:
EXEC xp_cmdshell ' net user mm 123/add '
EXEC xp_cmdshell ' net localgroup Administrators Mm/add '
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.