CREATE DATABASE permission denied in database 'master'



CREATE DATABASE permission denied in database 'master'

Sometimes we find errors like bellow when creating a database in Microsoft SQL Server Management Studio.

TITLE: Microsoft SQL Server Management Studio

------------------------------

Create failed for Database 'Mydatabase'.  (Microsoft.SqlServer.Smo)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=11.0.3000.0+((SQL11_PCU_Main).121019-1322+)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Create+Database&LinkId=20476

------------------------------

ADDITIONAL INFORMATION:



An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

------------------------------

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



For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&ProdVer=10.50.1600&EvtSrc=MSSQLServer&EvtID=262&LinkId=20476

------------------------------

BUTTONS:

OK

------------------------------

The reason is you don’t have permission to create a database or you did not access the SQL Server Database Engine as a system administrator.

To resolve this scenario you have to permit the particular user access from login to admin of SQL Server contact your SQL Admin.

Sometimes scenario also comes when you log in with windows authentication in your system the reason may be as below... 
  1. All logins that are members of the sysadmin fixed server role have been removed by mistake. 
  2. All Windows Groups that are members of the sysadmin fixed server role have been removed by mistake. 
  3. The logins that are members of the sysadmin fixed server role are for individuals who have left the company or who are not available. 
  4. The sa account is disabled or no one knows the password.
To resolve this problem follow step by step instruction
  1. Start SQL Server Management Studio ->Click View->Click Registered Server


  1. Note: If your server is not already registered then right-click Local Server Groups-> Point to Task -> then click Register Local Server. 
  2. In the registered area, right-click on your server ->then click SQL Server Configuration Manager.


  1. Close SQL Server Management Studio.
  2. In SQL Server Configuration Manager click on SQL Server Services at the left panel, in the right panel you will find all instance of SQL Server, find your instance, The default instance of SQL Server includes (MSSQLSERVER) like SQL Server(MSSQLSERVER)
  3. Right-click the instance of SQL Server, and then click Properties. 
  4. Click on startup parameter box, type -m and then click Add (That's a dash then lower case letter m.). 
  5. Click OK, and after the message to restart, right-click your server name, and then click Restart.

6.  After SQL Server has restarted your server will be in single-user mode. Make sure that that SQL Server Agent is not running. If it started, it will take your only connection.
.

Related Posts

What is the Use of isNaN Function in JavaScript? A Comprehensive Explanation for Effective Input Validation

In the world of JavaScript, input validation is a critical aspect of ensuring that user-provided data is processed correctly. One indispensa...