Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. SQL Server
  3. Question
SQL Server

What should I do if I receive this - create database permission denied in database master?

Asked by Aalap Prabhakaran Sep 29, 2022 3.5K views 2 answers
Share

About this question

 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 do I need to do? Please suggest a fix!

Your answer

2 Answers

Ranjana Admin JanBask Expert Latest answer

Answered on Jun 7, 2024

If you receive the error "CREATE DATABASE permission denied in database 'master'", it means that your user account does not have the necessary permissions to create a new database. Here are the steps to resolve this issue:

1. Check Your Permissions

First, confirm that your user account does not have the required permissions:

USE master;

SELECT * FROM sys.database_permissions WHERE grantee_principal_id = DATABASE_PRINCIPAL_ID('YourUserName');

2. Contact the Database Administrator (DBA)

If you don't have the necessary permissions, you'll need to contact your DBA or the person responsible for managing database permissions. Request that they grant you the required permissions to create databases.

3. Granting Permissions

If you have access to an account with sufficient privileges (such as a sysadmin or a user with the dbcreator role), you can grant the necessary permissions to your user account.

Option 1: Grant the dbcreator Role

The dbcreator role allows a user to create, alter, drop, and restore databases.

  USE master;ALTER SERVER ROLE dbcreator ADD MEMBER [YourUserName];

Option 2: Grant Specific Permissions

Alternatively, you can grant specific permissions to create a database:

USE master;

  GRANT CREATE ANY DATABASE TO [YourUserName];

4. Verify Permissions

After granting the permissions, verify that the user has the correct permissions:

  USE master;SELECT * FROM sys.database_permissions WHERE grantee_principal_id = DATABASE_PRINCIPAL_ID('YourUserName');


Was this helpful?

More SQL Server discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest SQL Server Blogs

Guides, tips and career advice on SQL Server from JanBask experts.