Permission to create a database denied by the master database

Asked

Viewed 1,161 times

3

I am trying to migrate the database created automatically by Identity to control user authentication and this error appears:

CREATE DATABASE permission denied in database 'master'.

My string Connection looks like this:

<add name="DefaultConnection" connectionString="Data Source=LPG-11;Initial Catalog=LPGPonto.Models.LPGPontoContext;Integrated Security=True;user id=sa;password=xxxxxx" providerName="System.Data.SqlClient" />

With this same user (sa - who is the master database owner) and password I can create database normally by Management Studio, but when I try to create by Visual Studio migration it gives this error. The user and password are correct, the user "sa" has permission for everything in SQL Server. What can be?

1 answer

1

I was able to create. The error was in my Connection string, in the Secutity User parameter. I changed it this way and it worked:

<add name="DefaultConnection" connectionString="Data Source=LPG-11;Initial Catalog=LPGPonto.Models.LPGPontoContext;Integrated Security=False;user id=sa;password=xxxxxx" providerName="System.Data.SqlClient" />

Browser other questions tagged

You are not signed in. Login or sign up in order to post.