13

I'm trying to create a database on my local machine using SSMS version 11.0.2100.60. I've run the application as administrator, logged in using Windows authentication, and I've added MYDOMAIN\my-username to the Logins. However if I try to create a db with this login I get the message

CREATE DATABASE permission denied in database 'master'. 
(Microsoft SQL Server, Error: 262)

If I try to add the privelage dbcreator to my user, I get the following error.

User does not have permission to perform this action. 
(Microsoft SQL Server, Error: 15247)

I can't log in as sa as I don't know/remember the password (is there a preset default?), and if I try to change the password I get the message:

Cannot alter the login 'sa', because it does not exist or you do not have permission. 
(Microsoft SQL Server, Error: 15151)

Finally I note that the account 'sa' is disabled, and if I try to enable it I get the same error as before. Is there any way around this or do I need to re-install?

Version info:

Microsoft SQL Server Management Studio                      11.0.2100.60
Microsoft Analysis Services Client Tools                        11.0.2100.60
Microsoft Data Access Components (MDAC)                     6.2.9200.16384
Microsoft MSXML                     3.0 4.0 6.0 
Microsoft Internet Explorer                     9.10.9200.16635
Microsoft .NET Framework                        4.0.30319.18051
Operating System                        6.2.9200
1
  • Try running SSMS as administrator
    – gerrytan
    Jun 17, 2014 at 2:37

3 Answers 3

8

A little more specific :

  1. Open Sql Configuration Manager.
  2. Select SQL Server Services.
  3. On the right hand side, select the instance.
  4. Right click on it and open properties.
  5. In the advanced tab attach ";-m" at the end of the Startup Parameters field.
  6. Apply and restart the service.
  7. Now you have privilege to enable "sa" user and modify its password.
  8. once done, remove ";-m" and restart the service.
  9. You are good to go.
4
  • 1
    Add button is disabled. please let me know to to add parameter Oct 8, 2018 at 7:41
  • 2
    This answer is priceless Jul 5, 2019 at 11:23
  • 2
    For clarity just add -m Under Startup Parameters Tab. Also I was not able to start SQL Server Configuration Manager , Got some WMI provider error, Check this video to fix it.
    – Shaiju T
    Nov 7, 2019 at 19:17
  • The next steps after this are to open an elevated command prompt and run sqlcmd -S .\SQLEXPRESS and then EXEC sp_password NULL, 'yournewpasswordhere', 'sa'
    – M.M
    Apr 29, 2022 at 4:59
7

I found the answer here:

In order to start SQL Server in single-user mode, you can add the parameter “-m” at the command line. You can also use the SQL Server Configuration Manager tool, which provides proper controls for the file access and other privileges. To use the Configuration Manager tool to recover your system, use the following steps:

  1. Open the Configuration Manager tool from the "SQL Server 2005| Configuration" menu
  2. Stop the SQL Server Instance you need to recover
  3. Navigate to the “Advanced” tab, and in the Properties text box add “;–m” to the end of the list in the “Startup parameters” option
  4. Click the “OK” button and restart the SQL Server Instance
1
  • Thanks sir!. I thought that there is no solution for this except uninstalling SQL server! Dec 28, 2018 at 18:02
2

I'd like to point out an alternative answer laid out on DBA SE. Download PSExec onto the box that is having the problem and follow the instructions laid out in this blog post to effortlessly change admin settings using the NT Authority\System account.

./psexec -s -i "C:\...\Ssms.exe"

Wanted to share this solution as it solved my problem!

4
  • "You may need to disable UAC" - not an option for me... but otherwise yes, that looks like a good solution
    – tdc
    Nov 26, 2013 at 10:49
  • I was able to do it without changing the UAC settings! The only problem would be if you are not allowed to move files onto your network without authorization; I know that issue exists in many domains.
    – Shrout1
    Nov 26, 2013 at 13:14
  • It was useful to find out--if only upon running PsExec.exe and seeing the license agreement--that sysinternals is "a wholly owned subsidiary of Microsoft."
    – fortboise
    Dec 1, 2014 at 17:49
  • I was able to mod sa password and enable login on a SQL Server Express 2008 instance with the NTAUTHORITY super-powers, but trying to likewise fix a SQL Server 2012 installation, it fails, says my login doesn't have permission. What to do when the power tool fails?
    – fortboise
    Dec 1, 2014 at 20:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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