When I browse to a SharePoint site, I got the Server Error in ‘/’ Application, Cannot connect to the configuration database.
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.
There are different ways to check all possibilities. Few of them are as below:
1) Verify that the SQL database is running and services.
2) Firewall can block access and communication with your Microsoft SQL Server Server.
3) User Permissions.
I tried all the options. I observed into event viewer that my servers Timer service is getting crashed after few seconds. I found it might caused by the fact that the Configuration Cache directory (C:\ProgramData\Microsoft\SharePoint\Config) did not contain a folder with the farm GUID as the name.
While trying to resolve the above error, I came across the entry of dsn in the registry at the same location HKLM > SOFTWARE > Microsoft > Shared Tools > Web Server Extensions > 14.0 > Secure > ConfigDB
The connection was made using IP address 10.10.10.1 which means that while running the product configuration wizard of SharePoint, the server farm installation was selected and the IP address 10.10.10.1 was chosen instead of computer name MYCOMPUTERNAME for the database connection.
Somehow, IP address 10.10.10.1 was removed and re-added the IP address, restarted all services (sql server, IIS Admin & Sharepoint). All the web applications are working fine.
Hope this will help someone!!!