我不知道 SA 密码,因此我以单用户模式重新启动了 SQL Server 2008 Standard Edition 实例,希望更改 SA 密码。之后我立即尝试连接
sqlcmd -S serverName\ss2008
Msg 18461, Level 14, State 1, Server serverName\SS2008, Line1 Login failed for user 'serverName\Administrator'. Reason: Server is in single user mode. Only one administrator can connect at this time.
我尝试立即更改密码
C:\Documents and Settings\Administrator>sqlcmd -U sa -z p@ssword Password: Msg 18470, Level 14, State 1, Server serverName, Line 1 Login failed for user 'sa'. Reason: The account is disabled.
-m 真的代表零用户模式吗?还是我的服务器出了什么严重问题?
最佳答案
您的连接可能会立即被其他一些服务(例如 SQL Agent、Reporting Services)占用
您可以使用 -m
开关传递可选的附加客户端名称参数。
例如使用
-m"sqlcmd"
仅允许将自身标识为 sqlcmd 客户端程序的程序获取单个可用连接。 See the docs for more about this.
关于sql-server - SQL Server 2008在单用户模式下不允许连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10741187/