首页 > 数据库 > SQL Server > Troubleshooting: Connecting to SQL Server When System Administrators Are Locked Out
[run as Admin]
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:Windowssystem32>
C:Windowssystem32>net stop mssqlserver
The SQL Server (MSSQLSERVER) service is stopping.
The SQL Server (MSSQLSERVER) service was stopped successfully.
C:Windowssystem32>net start mssqlserver /m
The SQL Server (MSSQLSERVER) service is starting.
The SQL Server (MSSQLSERVER) service was started successfully.
C:Windowssystem32>sqlcmd
1> EXEC sp_addsrvrolemember 'MSDOMAIN1RT-DBA', 'sysadmin';
2> GO
1> quit
C:Windowssystem32>net stop mssqlserver
The SQL Server (MSSQLSERVER) service is stopping.
The SQL Server (MSSQLSERVER) service was stopped successfully.
C:Windowssystem32>net start mssqlserver
The SQL Server (MSSQLSERVER) service is starting.
The SQL Server (MSSQLSERVER) service was started successfully.
C:Windowssystem32>
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/66009/viewspace-1060770/ ,如需转载,请注明出处,否则将追究法律责任。