Create DATABASE permission denied in database 'master'

Problem

If the user running the application pool does not have the rights to create a database on the SQL instance, it will not be able to create the server database the first time you access the web application. You will get the following error message:

Solution

To solve this the application pool user need sufficient privileges in the database:

  • open the SQL Server Management Studio and connect to the database instance used when mounting databases
  • expand Security / Logins
  • right-click on the IIS application pool identity setup for the application - it is often the NT AUTHORITY\SYSTEM user
  • select Properties and Server Roles
  • include the server role: sysadmin to enable the application to handle databases