Thursday, 21 October 2010

Cannot connect to database master at SQL server

During installation of SharePoint 2010 the Configuration Wizard could not connect to the SQL Server database:
Cannot connect to database master at SQL server at SERVERNAME. The database might not exist, or the current user does not have permission to connect to it.
Several blogs where dealing with the permissions, which I checked, but they were well set. The actual problem was the TCP/IP setting of SQLServer. The TCP/IP protocol for the SQL Server was disabled (default setting on installation). Enabling this setting solved the problem.
Enabling can be done using the Sql Server Configuration Manager. Go to SQL Server Network Configuration > Protocols for MSSQLSERVER (or the named instance name you are using) en check the TCP/IP protocol status. This should be 'Enabled'.

So, if you are running into this error, check the user accounts settings as well as the TCP/IP settings of the SQL Server.

Update (23 August 2012): I just add an extra addition: Make sure that SQL server is listening on port 1433 (Thanks to Suolon)

7 comments:

Pete said...

Thanks for the refresher. Not sure why I always forget this nuggets. One thing you'll probably have to do after you enable TCP/IP is to recycle the SQL Service

Robje said...

Yes, you can do that, but it is not always needed. If you still struggle with the problem after enabling TCP/IP, you can restart the SQL Server service indeed.

JPeyatt said...

You, sir, are a life saver!

Robje said...

@JPeyatt: Thanks a lot. I love sharing information in this way to hope to help others with (similar) problems.

Purnima Swamy said...

i have done all the setting as you mentioned but still gives the same error.

Suolon said...

Took me a day and a half to figure this out, but not only do you need to enable TCP/IP, but you have to be sure that SQL server is listening on port 1433. For some reason, our SQL Express install did NOT use 1433, so I had to manually set it.

Robje said...

Thanks Suolon for this addition!