Cannot connect to the configuration database

When I tried to browse a SharePoint Site, I got the below error.

Cannot connect to the SharePoint configuration database. 

SharePoint Cannot connect to the configuration database


Cause

The “Cannot connect to the SharePoint configuration database” issue might occur because of

  1. The SQL Server Services was stopped.
  2. You have changed your farm account and you need to update its credentials.
  3. The account used to run the SharePoint application pool didn’t have a sufficient privilege to connect to the configuration database.
  4. Network connectivity issue with SQL Server.

Solution

SQL Server Services is stopped.
  • Open SQL Server Configuration Manager.

SQL Server Configuration manager

  • In SQL Server Services, check that SQL Server Instance is running and it’s agent.

Open SQL Server Configuration Manager

  • If it was stopped, try to restart it.
  • If it was unable to start,
    • Right click on service.
    • Select properties > Reset the account credentials > Click start.

Reset SQL Server Account

For more details check Unable to start SQL Server service.


Update Farm Account Credential Using PowerShell

If you have changed your Farm account, you may get “Cannot connect to the SharePoint configuration database”. if you didn’t update the Farm credential using PowerShell.


stsadm -o updatefarmcredentials -userlogin domain\username -password


Network connectivity between SharePoint Server and Database Server
  • On SQL server, Make sure that the TCP/IP has been enabled.

SQL Server Netowrk Configuration - TCP IP

  • On the Application Server, Try to telnet to the database server IP & port (In case, it’s highly available, try to use the Virtual IP ).

For more details check Enable the telnet client feature on Windows Server.

  • Also, you can use UDL file to check connectivity between App server and SQL Server instance

Data Link Properties.png

For more details check How to Check SQL Server Instance Connectivity from the application server to database server for a specific user.

  • Make sure that the firewall didn’t block the SQL Server Port (default port is 1433)

firewall properties

Check this steps with your system and network administrators, or disable the firewall state in case, it’s dev environment.


The SharePoint application pool account didn’t have a sufficient privilege to connect to the configuration database.
  • Open IIS > Application pool.
  • Select the application pool for your web application > Advance Settings > Identity.

Change the identity Application pool in IIS

Make sure that the application pool account (Identity) is a member of WSS_WPG.

the application pool account is a member of WSS_WPG

Make sure that the application pool account (Identity) has a sufficient privilege on the following database.

  • db-owner‘ and ‘SP_DATA_ACCESS’ on all web application Content Databases.

Configuration database permissions for SharePoint Application Pool

  • WSS_CONTENT_APPLICATION_POOLS‘ on SharePoint Config database.
  • WSS_CONTENT_APPLICATION_POOLS‘ on SharePoint_Admin.

content database permissions for SharePoint Application Pool


Applies To
  • SharePoint 2016.
  • SharePoint 2013.
  • SharePoint 2010.

See Also
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s