I don't know the SA password so I restarted my SQL Server 2008 Standard Edition instance in Single-user mode with the hope of changing the SA password. Immediately afterwards I tried connecting with
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.
My attempts at changing the password right out yields
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.
Does -m really stand for zero-user mode, or is there something horribly awry with my server?
Right-click on SQL Server service and click on the Restart to restart the SQL Server instance. SQL Server will start in single user mode. Now connect to SQL Server using SQL Server Management Studio or SQLCMD.
The following common scenarios can cause connectivity problems: Incorrect IP address for the Server field. Make sure that the IP address matches the entry in the SQL Server error log file. Incorrect server name in the Server field.
Scroll down to get 'STATE' field. Select Restrict access option from STATE field. Select MULTI_USER from dropdown menu. Click 'OK'.
Your connection may be being taken immediately by some other service (e.g. SQL Agent, Reporting Services)
You can pass an optional additional client name parameter with the -m
switch.
e.g. using
-m"sqlcmd"
Will only permit the single available connection to be taken by a program that identifies itself as the sqlcmd client program. See the docs for more about this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With