CREATE DATABASE permission denied in database 'master'

Topics: User Forum
Feb 2, 2009 at 3:03 PM
I've installed SLK in a test environment in the past, but when trying to install on my production server I receive the above error while trying to configure SLK to create the database. I installed a new SLK SQL 2005 express instance and entered the correct Server\instance details. I've checked the correct site collection is selected. Having searched through the discussions I've seen several mentions of this error, but none seem to apply/resolve my issue. Is SLK using the credentials used to logon to the Central Admin site to create the database? Should I need to assign the account (domain admin) permission to the instance, I thought this was only an issue on Vista? The platform is Server 2003 SP2 WSS3 (latest SP). Thanks

This is the event log event:

Event Type: Error
Event Source: Windows SharePoint Services 3
Event Category: None
Event ID: 0
Date:  02/02/2009
Time:  15:00:09
User:  N/A
Computer: BMS-SR-APPS1
SharePoint Learning Kit Error

System.Data.SqlClient.SqlException: CREATE DATABASE permission denied in database 'master'.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)
   at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
   at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
   at Microsoft.SharePointLearningKit.SlkAdministration.CreateDatabase(String databaseServerConnectionString, String databaseName, String databaseConnectionString, String appPoolAccountName, Byte[] appPoolSid, String databaseSchema)
   at Microsoft.SharePointLearningKit.SlkAdministration.<>c__DisplayClassb.<SaveConfiguration>b__4()
   at Microsoft.SharePointLearningKit.SlkUtilities.ImpersonateAppPool(VoidDelegate del)
   at Microsoft.SharePointLearningKit.SlkAdministration.SaveConfiguration(Guid spSiteGuid, String databaseServer, String databaseName, String schemaToCreateDatabase, String instructorPermission, String learnerPermission, Boolean createPermissions, String settingsFileContents, String defaultSettingsFileContents, String appPoolAccountName, ImpersonationBehavior createDatabaseImpersonationBehavior)
   at Microsoft.SharePointLearningKit.AdminPages.ConfigurePage.BtnOk_Click(Object sender, EventArgs e)

For more information, see Help and Support Center at

Feb 2, 2009 at 4:29 PM
The database creation call is made in the context of the user the SharePoint Central Administration web application is running as.

SLK Co-ordinator
Feb 2, 2009 at 5:08 PM
Thanks Richard,.

I'm running Central Admin as a domain admin, which is the same user used to install the SLK SQL Express instance. Using SQL Management Studio I can login to the instance with the aforementioned user and create a test database and delete it again, which suggests it has the necessary permissions, right?
Feb 2, 2009 at 8:20 PM
That sounds like it should work then. Best thing to do is run Sql Profiler while attempting it and seeing who the connection is being made as.

Feb 3, 2009 at 4:52 PM
I downloaded Profiler for SQL express and saw that the DB connections were being made in the context of the network serivce. In SQL studio, Network Service wasn't in the list of accounts with permission to login to the DB, nor was it in the browse list of available accounts (I also tried manuallying typing in NT Authority\Network Service in case it was hidden). I also tried restarting the SQL instance to no avail.

I came across a general SQL page relating to the error in the subject (which I now can't find) that suggested when Network Serivce is trying to access the DB, the server needs to be rebooted after installation of the new instance. After rebooting, the SLK config page created the SLK database successfully. I checked the SLK instance and noticed that Network Service had been added to the list of accounts with permission to the DB, I also checked that the network service had also appeared in the list of available accounts in the browse list.