Travis Tubbs
Travis Tubbs

Reputation: 877

CREATE TABLE permission denied in database 'master'.

I am deploying my MVC app on a windows server 2016 instance.

I deployed my website to IIS on my local machine first and everything worked just fine. I then went to my server, installed the EXACT same database (but it is empty) to my server and then deployed my application via File System.

However, it is giving me the CREATE TABLE permission denied in database 'master'. error.

How do I fix this? Again, this does not happen when I run it on my local machine with the exact same database name.

Upvotes: 1

Views: 4440

Answers (3)

Mohammad AlShaabi
Mohammad AlShaabi

Reputation: 79

I was getting the same error, what I did I verified my connection string in the app service configuration and I found a small mistake in it, I corrected it and it worked fine for me.

Azure portal >> App service >> Configuration >> Connection Strings

Upvotes: 0

Travis Tubbs
Travis Tubbs

Reputation: 877

So here it is, I almost forgot this question was still opened.

When I deployed my application to IIS I had to also install microsoft SQL to the server. When installing the microsoft SQL server you are asked about permissions and which user can access the database.

Well IIS runs on a different user access level than perhaps "Travis" or "Joe". I solved this problem by simply chosing "Everyone" when setting up microsoft SQL this is probably not best practice, but it allowed me to connect to my database and move on to other problems!

Upvotes: 1

I don't now what really fixed my problem, but

I delete next code from web.config

<contexts>
    <context type="......, .....">
        <databaseInitializer type="......" />
    </context>
</contexts>

set user settings as owner and set my DB as default in sql/logins/Mylogin ->right click - properties.

Upvotes: 0

Related Questions