I am making a database in sql server and it shows an error that "CREATE DATABASE permission denied in database 'master'" I am using the administrator log in itself. What i need to do? Please suggest a fix!

This is the screenshot and the error message i used to get when i create a database in sql server 2008

  • Do you use the Windows admin login or the SQL Server admin? If the former, it doesn't neccessarily mean that the Windows admin is a SQL Server admin automatically. Can you try it using the sa account? – Lmu92 Aug 31 '14 at 7:45

The user must be a member of dbcreator server role for user to have enough permissions to create a database.

You can execute the following statement to make a user member of dbcreator server role.

EXEC master..sp_addsrvrolemember @loginame = N'Shubhankar', @rolename = N'dbcreator'

Members of sysadmin role are by default members of dbcreator server role therefore they can create databases too.

| improve this answer | |
  • User does not have permission to perform this action. – Christine Oct 26 '16 at 16:56
  • @Hill then you need to ask your DBA to add your in the correct Server Role. – M.Ali Apr 17 '18 at 12:04
  • 3
    sp_addsrvrolemember is in maintenance mode and should not be used anymore, rather user alter server role, e.g. alter server role dbcreator add member [domain\user]. See SQL Server Docs: sp_addsrvrolemember. – Triamus Dec 14 '19 at 17:49

To create database you need sysadmin role permission for the user. Go to Database-> Security -> Logins section in object explorer and edit the properties of the user that you want to have create permission. In the Server Roles section you can find sysadmin. Tick it and save the user. Now you will have access to create database.

For Reference : http://social.msdn.microsoft.com/Forums/sqlserver/en-US/76fc84f9-437c-4e71-ba3d-3c9ae794a7c4/sql-express-2008-r2-create-database-permission-denied-in-database-master?forum=sqlexpress

| improve this answer | |

All the above points are clear but there is one which is missing. I struggled to find the solution to this problem and finally got it after long research.

To get permission to create database in your local account follow the below given steps.

Step 1: Disconnect from your local account.

Step 2: Again Connect to Server with Login : sa and Password : pwd(pwd given to your local login).

Step 3: Object Explorer -> Security -> Logins -> Right click on your server name -> Properties -> Server Roles -> sysadmin -> OK

Step 4: Disconnect and connect to your local login and create database.

Successfully created the database :D ;)

| improve this answer | |

I was having same problem, I noticed I was connected using Windows Authentication. I then disconnected and used SQL Server Authentication. It started good.

| improve this answer | |