Home >Database >Mysql Tutorial >How to deal with the sqlserver account being disabled
What should I do if I find that all sqlsrver accounts have been accidentally disabled? Reinstall? This article mainly introduces how to deal with the disabled sqlserver account. Friends in need can refer to it. I hope it can help everyone.
First, you need to add a new account in Windows account settings. And add it to the administrator group, and then follow the following steps (note that /m is switched to single-user login mode. After the modification is completed, it is recommended to switch to multi-user mode):
(1) Go to Sqlserver's "Configuration Tools" SQL Server Configuration Manager", select "Sql Serve Service" to expand and stop all sql services
(2) Run cmd.exe as an administrator and execute the following command:
net stop sqlserver实例名(可以在Sql Serve服务下选择SQL Server(...)右键属性里找到) net start sqlserver实例名 /m(可以在Sql Serve服务下选择SQL Server(...)右键属性里找到)
(3) Next execute the sqlcmd command (if you don’t know how to use it, you can use Baidu sqlcmd), enter it in the following order, and press Enter to execute.
create login kk with password='kk#12345'; go sp_addsrvrolemember 'kk', 'sysadmin' go
(4) Repeat (2) and remove /m. After success, you can log in with your kk account, and then enable the account you want
Related recommendations:
sqlserver query to lock sql and unlock it
Explain the sqlserver paging query processing method
MYSQL synchronizes Sqlserver database data
The above is the detailed content of How to deal with the sqlserver account being disabled. For more information, please follow other related articles on the PHP Chinese website!