Sql-server – CREATE DATABASE permission denied in database ‘master’ in visual studio 2010

asp.net-mvc-4forms-authenticationmembership-providersql server

CREATE DATABASE permission denied in database 'master'.when i try to implement the Authentications using web matrix . i will try to add new database in local server explorer dynamically using mvc4 internet template but i have the below issue "CREATE DATABASE permission denied in database 'master' in visual studio 2010 ?". I don't know what is the permission issue. could someone help me?
The error comes in this line in global.asax
WebSecurity.InitializeDatabaseConnection("DefaultConnection", "UserProfile", "UserId", "UserName", autoCreateTables: true);

Best Answer

It seems to be a connection issue with SQL Server, most likely you do not have a connection string correctly setup.

Based on your connection string setting, User Id and Password is required if you use Integrated Security=False. You will need to specify a User Id and Password which has permission to create the database. Please check this link for user permission issue and this link to know how you can specify user id and password correctly. The user Id used in connection string should have the permission to create database.

In case its set to SSPI or True, the windows user credentials will be used to verify permission.

If this does not solve the issue, please share your connection string.

Related Topic