Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I have started my SQL Server 2008 sqlcst02\inst01 in Single User Mode by appending the ;-m to the end of the startup parameters for this instance in SQL Server Configuration Manager. I have stopped SQL Server Agent for the inst01 instance. My account is a member of the Domain Admin group and I have attempted to login using sqlcmd -S sqlcst02\inst01 and keep getting an error that the service is in Single User Mode and only one administrator can be logged in. I tried adding ;-m"sqlcmd" to the startup parameters to limit the connection to just sqlcmd but I get the same results. I have tried this logged in as my own account and logged in as the local administrator account. I have started the command prompt as myself and as administrator but I get the same results. I have tried connecting using ADMIN:sqlcst02\inst01 in SSMS. No luck.

I'm attempting to reset the sa password as none of this information was left for me by the previous admin. This is maddening. I've done this before on other machines with no issues.

share|improve this question
1  
Is your domain account (either explicitly or via a group) a member of the sysadmin server role on the SQL Server instance? –  Brian Knight Jan 9 '13 at 17:12
    
I don't know. I know I am a member of the Domain Admin group and a SQL ADMINS group, and that the SQL ADMINS group is a member of the sysadmin role on all of the other servers. but I'm betting that's not the case on this machine. –  Bill Healy Jan 9 '13 at 18:58
    
are your SQL running on a cluster? in that cluster service has open connection to SQL before you. Another possibility you have a service or application that is establishing connection to SQL server as sysadmin before you as an admin are able to connect. –  SQL Learner Jan 9 '13 at 22:01
    
There's nothing wrong with the connection, and nothing wrong with the login. If you get to the point of seeing the single user mode error, you have to figure out what else is connecting to the instance, and prevent it for at least as long as it takes for you to establish the connection yourself. –  Jon Seigel Jan 9 '13 at 22:47
add comment

migrated from stackoverflow.com Jan 9 '13 at 21:26

This question came from our site for professional and enthusiast programmers.

3 Answers

Another alternative to recovering access to a SQL Server is outlined in this article, and doesn't require restarting in single user mode:

http://www.mssqltips.com/sqlservertip/2682/recover-access-to-a-sql-server-instance/

Essentially, download PSExec, then run it with the following command line (fill in your location of SSMS.exe):

PsExec -s -i "C:\Program Files (x86)\...\ssms.exe"

You will be prompted to connect - the authentication mode will be Windows auth and hard-coded to NT AUTHORITY\SYSTEM. Once connected, you will be able to go into security and fix the sa password, add yourself as admin, add other admins, etc.

The article above has several caveats you should read before trying this, and you may also want to review the comments at the bottom.

share|improve this answer
    
YOU ARE MY SAVIOR. (Sorry for the all caps... but... phew) –  Shrout1 Nov 25 '13 at 21:13
add comment

I just got bitten by this one. What I had forgotten was to run the CMD prompt as administrator. This is not the default in Windows 2008 R2. Once I did this all was well. One of my colleagues suggested this issue and hey presto all fixed. I feel like an idiot but I thought I would share to save others.

share|improve this answer
add comment

OK - if you are not in the sysadmin role on SQL Server, you will not be able to enter via single-user mode. If you are an administrator on the server itself, you can use the answer in this post to help you out.

share|improve this answer
    
If you are an administrator on the server itself you can login via single user mode as described in the docs and it will treat the connection as though you are in the sysadmin role. Which as far as I can see is exactly what the blog post that is linked to from your other link does. –  Martin Smith Jan 9 '13 at 22:06
add comment

Your Answer

 
discard

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