I've been trying all sorts of different combinations of startup flags to SQL Server 2008 R2 Express and I can not get past this error:
Login failed for user 'LOCALSERVER\Administrator'. Reason: Server is in single user mode. Only one administrator can connect at this time. (Microsoft SQL Server, Error: 18461)
I've tried starting it up in Single User mode by both -m"SQLCMD"
and -m"sqlcmd"
and Iv'e even tried to start it up with -m"Microsoft SQL Server Management Studio - Query"
and connecting with the appropriate clients I ALWAYS get this error. I'm 99% sure that nothing else is stealing my connection and when connecting with SSMS I make sure to do the "new query-connect` method to ensure it only uses 1 connection.
Has anyone else had this problem? How do I fix it and login?
Here's a solution I just found to this old issue:
If not started as administrator (as I wasn't), then you'll receive the generic an admin is already connect. Instead of saying you can't connect because you aren't an administrator.
Another confusing error from Microsoft. I suppose the same issue will exist with a sqlcmd too
Regards
Liam
Despite Microsoft saying otherwise you shouldn't quote after the -m. So for SQLCMD, you'd do
-mSQLCMD
. I didn't see this said anywhere, so I'll document it here. If nothing else works, try not quoting it.There should't be anything after -m. The syntax should look like:
You then log into the instance using sqlcmd and make the needed changes. If you try to use SQL Server Management Studio to log in you won't be able to as SSMS requires several connections to log in.
I just had this exact problem and all that I had to do was:
I reconnected SQL browser and it worked again. So instead of trying all the extra steps, people should really try the simplest approach that works first before escalating to more thorough attempts.
Changing User Account Control to Never Notify resolved the issue for me