EricHarlan

Re Gain access to SQL Server

The other day while installing the latest SharePoint 2013 environment build and I ran into an issue I’ve never seen before. I was getting the error “User does not have permission to perform this action. (Microsoft SQL Server, Error: 152427) in SQL.

For some reason the SQL server instance I was using for a long time no longer had access to create any databases. This is obviously a problem when trying to install SharePoint 2013 as the account you use needs to have rights to DBCreator.

Interestingly enough, the account I was trying to use was literally the same account I’d always used. I was doing a lot of virtual networking and adding servers to the domain so I’m not sure if something got mucked up in the process and to this point I’m still not sure what caused it, but that’s beside the point.

I’d done some searching to see if anyone else had this issue and the only solution I came across was essentially re-install SQL. That wasn’t an option for me I just didn’t have the time. I sent out a tweet pretty much explaining my situation. After a lot of twitter traffic and a lot of helpful folks I got turned onto this blog post Gaining SQL Server Sysadmin Access. Chad walks through creating a batch file to gain access again so I wanted to show the exact steps I went through.

First the problem

This was the error I got while trying to pretty much do anything with my previous SQL Admin account

I made sure the windows SQL Server Service was correctly running under the account I wanted to grant permissions to and it was.

This is when I use Chad’s method. In his post you can copy the code and paste it into a notepad instance. Save the file and name it “AddDBA.bat”. Copy this file over to your SQL instance (c drive is easiest).

Next open up your command prompt as administrator.

Type in “cd c:\AddDBA dcsql\InstanceName contoso\Administrator”

Dcsql=the name of your sql server

InstanceName=the name of your SQL instance. If you don’t have one and you’re just using a single SQL server don’t even enter the “\InstanceName” just leave your SQL server name in there nothing else

Contoso\Administrator=the name of the account you want to grant access for

You should see something like this.

I rebooted my box and when it came back up I was able to grant the proper permissions! Thanks to: Chad Miller

@ferringer

@enriquelima

@nkhamis

@resing

@toddklindt

Leave a Reply

Your email address will not be published.

No seriously, are you human? *