SharePoint 2010: Troubleshooting - Cannot Connect to the Configuration Database

SharePoint 2010: Troubleshooting - Cannot Connect to the Configuration Database


Symptoms

"Cannot connect to the configuration database orUnable to connect to database. Check database connection information and make sure the database server is running."
This is “the” error that everyone has once in his life seen on SharePoint Product Configuration Wizard..


Causes

There are many reasons why:

  • You applied a Hotfix or Service Pack to your SQL Server and have not restarted the SQL Server.
  • The SQL database may not be running.
  • The account that is used by application pool does not have the required permissions to the SQL Server database.
  • Network connectivity has been lost between the SharePoint Server and the Microsoft SQL Server server.


Troubleshooting steps

1. Verify that the SQL database is running and services..

In the list of services, locate the MSSQLSERVER service. And be sure that it’s running.
Be even sure that on the Microsoft SQL Server server, the following services are running:
  • SQL BROWSER
  • All other SQL services..

 

2. Firewall, UAC, ...

Firewall

Firewall can block access and communication with your Microsoft SQL Server server, so you have 2 possibilities..

  1. Disable Firewall, easiest way..

  2. Or create 2 rules

    1. One inboud TCP rule with ports:1433,2383,2382
    2. One inbound UPD rule with port: 1434

UAC

Try right clicking and running as administrator and check if it goes away. Of course, if you added your user explicitly you’re probably fine, but just to get a cluster up and running I added my domain admins user to the DB - and of course that’s a membership that UAC will mask. Please DISABLE it!!

3. Is your SQL configured correctly?

Check if your installation is correct like it has to be: http://www.gknzcfc.net/subsite/how-to-install-sql-server-2008-r2

4. User Permissions

Next, you must verify that this account has the required permission the SQL Server database.

  1. Click Start, point to Programs, point to Microsoft SQL Server, and click Enterprise Manager
  2. In the left pane, double-click Microsoft SQL Servers, and then double-click your SQL server group.
  3. Double-click your server.
  4. Double-click Security.
  5. In the left pane, click Logins.
  6. In the right pane, double-click the user who you noted step 8 of the previous procedure.
  7. In the SQL Server Login Properties dialog box, click Server Roles.
  8. Click to select both the Security Administrators and theDatabase Creators check boxes, and then click Database Access.
  9. Under the Permit column, click to select the Windows SharePoint Services database.

 

5. Can they talk to each other?

  1. Verify that the Windows SharePoint Services server is using the correct IP address for the SQL server. To do this, run the ping command on the Windows SharePoint Services server.
  2. Verify that the Windows SharePoint Services server is obtaining the correct IP address for the SQL server from DNS. To do this, run the nslookup command from the Windows SharePoint Services server.
  3. Make sure that there are no incorrect entries for the SQL server. To do this, examine the Hosts file on the Windows SharePoint Services server. This file is in the following location:
    %systemroot%\system32\drivers\etc\Hosts
  4. On the Windows SharePoint Services server, look for SQL client aliases. To do this, follow these steps: Click
    1. Start, click Run, and then type cliconfg in the Open box.
    2. Click the Alias tab. By default, there are no SQL client aliases. If you have any aliases for the SQL server, verify that they are correct, or remove them.
  5. Open the SQL Server Configuration Manager (Start SQL Server 2008  Configuration Tools  SQL Server Configuration Manager
  6. Navigate to the SQL Server Network Configuration  Protocols for MSSQLSERVER node in the tree view
  7. Enable TCP/IP and Named Pipes (you’ll be warned that these changes will not apply until you the service is shut down)

6. SID

Please be sure that when you made a “copy” of your Virtual Machine, to made a sysprep and not to get the same SID !!! Use PSTOOLS for it ..

7. Reset Database-connection-timeout and is you’re DB up-to-data

  1. Follow http://technet.microsoft.com/en-us/library/cc263314.aspx and change the timeout to 45.
    stsadm -o setproperty -pn database-connection-timeout -pv 45

  2. Click Start, click Run, type cmd in the Open box, and then click OK.

  3. Change to the following directory:

    system drive\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\Bin

  4. Run the following command:
    psconfig -cmd upgrade -inplace b2b
Leave a Comment
  • Please add 3 and 6 and type the answer here:
  • Post
Wiki - Revision Comment List(Revision Comment)
Sort by: Published Date | Most Recent | Most Useful
Comments
  • Gokan Ozcifci edited Revision 21. Comment: changed site - updated content

  • Peter Geelen - MSFT edited Revision 15. Comment: cleaned HTML and typos

  • Naomi  N edited Revision 12. Comment: Minor edit, title case

  • Gokan Ozcifci edited Revision 11. Comment: Tags

  • Gokan Ozcifci edited Revision 8. Comment: Added Content

  • Richard Mueller edited Revision 7. Comment: Replace RGB values with color names in HTML to restore colors

  • Richard Mueller edited Revision 6. Comment: Removed (en-US) from title, fixed typo

  • Gokan Ozcifci edited Revision 5. Comment: New site - gknzcfc.net

  • Ed Price - MSFT edited Revision 2. Comment: Title guidelines. Added tags.

  • Gokhan Ozcifci edited Revision 1. Comment: Contact

Page 1 of 2 (11 items) 12
Wikis - Comment List
Sort by: Published Date | Most Recent | Most Useful
Posting comments is temporarily disabled until 10:00am PST on Saturday, December 14th. Thank you for your patience.
Comments
  • Good article I ran into an error like this trying to run PSConfig for MOSS 2007 w/ SP1 on Server 2003 R2 x86 with the SQL Server 2008 R2 box running on a remote machine in the same domain. The exact error was:

    "SharePoint Products and Technologies Configuration Failed to connect to the database server or the database name does not exist. Ensure the database server exists, is a Sql server, and that you have the appropriate permissions to access the database server. To diagnose the problem, review the extended error information located at <path>. Please consult the SharePoint Products and Technologies Configuration Wizard help for additional information regarding database server security configuration and network access."

    I was getting the error on the Specify Configuration Database Settings page of the wizard.

    Cause:

    Database server filed had a value of contoso\sp2010 where contoso is the domain and sp2010 is the database server running SQL 2008 R2.

    Solution:

    Remove 'contoso\' from the Database server field so it's just sp2010 and click Next > button.

  • Craig Lussier edited Original. Comment: added en-US to tags and title

  • Gokhan Ozcifci edited Revision 1. Comment: Contact

  • Ed Price - MSFT edited Revision 2. Comment: Title guidelines. Added tags.

  • Gokan Ozcifci edited Revision 5. Comment: New site - gknzcfc.net

  • Sometimes the stadm part doesnt work id that is so then you need to follow the instructions i found on this blog heresjaken.com/sharepoint-cannot-connect-to-configuration-database-error-after-installing-kb-update-on-sbs-server-2008

  • Richard Mueller edited Revision 6. Comment: Removed (en-US) from title, fixed typo

  • Richard Mueller edited Revision 7. Comment: Replace RGB values with color names in HTML to restore colors

  • Gokan Ozcifci edited Revision 8. Comment: Added Content

  • Gokan Ozcifci edited Revision 11. Comment: Tags

  • Naomi  N edited Revision 12. Comment: Minor edit, title case

  • Peter Geelen - MSFT edited Revision 15. Comment: cleaned HTML and typos

  • Thanks Peter for your help !

  • Gokan Ozcifci edited Revision 21. Comment: changed site - updated content

Page 1 of 1 (14 items)