Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

Here's a solution I just found to this old issue:

  1. Stop all SQL services
  2. Start with -m
  3. Run MSSQL Management Studio As administrator

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



share|improve this answer
Running SSMS as Administrator is quite an important point. It wasn't working for me without that. – MrEdmundo Oct 20 '14 at 12:38

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.

share|improve this answer
This was absolutely 100% the problem I had. sqlcmd worked immediately after this. – hlmtre Feb 9 at 22:54

There should't be anything after -m. The syntax should look like:

sqlservr.exe -c -f -m 

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.

share|improve this answer
-m can be optionally suffixed by a "client name", in my case I needed it to be sqlcmd because other things would be trying to connect and steal my connection. – Earlz Dec 6 '11 at 20:55
Thanks, this was the right answer for me with SQL Server 2012. Stop/disable other SQL services, and run SSMS as administrator. – Noah Stahl Nov 24 '14 at 4:02

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.