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!
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It only takes a minute to sign up.Sign up to join this community
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' GO
Or you Can/Should use
ALTER SERVER ROLE [dbcreator] ADD MEMBER [Shubhankar]; GO
sysadmin role are by default members of
dbcreator server role therefore they can create databases too.
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 ;)
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.