Reputation: 12749
Visual Studio 2012 Express, EF5, Code First Migrations, Web Publish.
I am doing a web publish from a Windows 8 Laptop to a Windows Server 2008 R2 web server using Web Deploy from Visual Studio 2012.
The files are uploaded fine. But I get this error: CREATE DATABASE permission denied in database 'master'
When Code first tries to create the database.
The Web Publishing wizard uses a windows user to login - that user has db_owner permissions on the master database.
Exactly what do I need to do to grant CREATE DATABASE permissions? (or see which user tried to do it - the error doesn't report that for some reason?!).
Thanks.
Upvotes: 2
Views: 15376
Reputation: 11
If you'r running the application from IIS, then IIS APPPOOL\{Your apppool name} is the sql user trying to create the db. If there is no such user in you sql server then create one with the name IIS APPPOOL\{Your apppool name} and give server role dbcreator, public and sysadmin. Now I hope you won't see the error, code first should create the db.
Upvotes: 1