Rez's SharePoint Blog Spot

:


Add me to LinkedIn   RSS Feed   Follow me on Twitter
Rez's SharePoint Blog Spot > Posts > SQL Server 2008 – Administrator account denied access or locked out
March 28
SQL Server 2008 – Administrator account denied access or locked out

I don’t know how many times my clients have given me administrator access to the SQL Server machine thinking I will automatically have access to administer the SQL Server.  However, in SQL Server 2008 and above (i.e. SQL Server 2008 R2), there is a new security feature where the installer doesn’t automatically add the local server administrators group as SysAdmin on the server.  The person doing the install has to remember to do this during setup.  Most of the time, they don’t do it or forget to do it.

Take the following steps to add yourself as SysAdmin on the SQL Server to have full access:

1. Stop the SQL Server instance and the SQL Server Agent service in your services (by going to administrative tools –> services or typing in services.msc from your run box)

image

2. Open a command prompt as an Administrator

image

3. Locate your sqlservr.exe file (usually located in C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Binn directory) and CD to that directory:

CD C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Binn

image

4. Run the following command and ignore any errors that may occur during run – this starts the SQL Server Service in single user mode [1] :

sqlservr.exe -m -s MSSQLSERVER

Note: MSSQLSERVER above is the name of your instance – usually the same as the last item after the “.” in the directory path i.e. C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER )

image

 

5. Once that is run, check to see if the service in step 1 is activated (don’t forget to refresh the screen) and then open up SQL Server Management Studio

6. Once SQL Management Studio opens, go to the security tab, add your account and make them a SysAdmin

 

image

7. In your services, stop and restart the SQL Server and SQL Server Agent services

image

[1] http://msdn.microsoft.com/en-us/library/ms188236.aspx

Comments

Re: SQL Server 2008 – Administrator account denied access or locked out

This has to be one of my favorite posts! And on top of thats its also very helpful topic for newbies. Thanks a lot for informative information!
 on 2/13/2012 4:02 AM

Add Comment

Items on this list require content approval. Your submission will not appear in public views until approved by someone with proper rights. More information on content approval.

Title


Name


Your URL


Comments *

SPAMMER Skill Testing Question - What is 2x3? *


This field is to protect me against the barrage of spammers

Attachments