Error Establishing a Database Connection in WordPress

by Mitesh Singhal Singhal Industries Private Limited

While using WordPress, the users sometimes encounter some errors that make it difficult for them to access the WordPress website. This problem usually occurs when WordPress failed to make a connection with the database. In such a problematic situation, you’ll get to see an error establishing a database connection in the WordPress site. Let’s learn more about this error, causes, and troubleshooting steps.


Reasons for the occurrence of this error


There’s a high probability of this error if there is incorrect database information in the WordPress settings. Irresponsive database server or corrupt database can also cause you to experience this error.


For establishing a connection with the database, there’s a need for the database name, server, password, and username information. If these are having incorrect information, then WordPress will not connect you to the database.


Troubleshooting steps


  • Whenever you encounter WordPress Error 500, you need to check the WordPress database credentials to resolve this error. The WordPress database credentials are mainly stored in the wp-config.php file, so you need to edit it. Along with this, check that all the information on the database is correctly mentioned.


  • If your database information is correct, then you must proceed to check the information of the host.


  • The next solution is checking the Database Server. If it is down, then you might face error establishing a database connection in WordPress. This sometimes occurs because of heavy traffic on the server. A shared host cannot handle such load and then results in this error. Because of the extreme load on the server, the website will get slow down and can cause output error. In such a situation, it would better connect with the hosting provider and get rid of the technical issue.


  • If any of the steps mentioned above don’t work for you, try to update WordPress Site URL. For this, you will have to access phpMyAdmin from your dashboard, and then choose the WordPress database.


  • Rebooting the webserver can also be beneficial in the case of WordPress error 500. The users can do this on the local server, dedicated servers, or virtual private servers for rebooting it. Once you’ll do this, it will restart the database server as well as the webserver. If there will be any temporary glitches causing this error, then it will be rectified with this step.

  • For solving this database connection error on WordPress, you must try repairing the database. It would help if you made sure to remove the code from the wp-config.php when you’re done with the repairing of your database.




By following these troubleshooting steps, it would be easy for you to solve the error immediately. In case, all the solutions get failed, try seeking the assistance from the WordPress certified team. They’ll first analyze the problem for a proper diagnosis and identification of the root cause. The experts can help you fix the problem immediately. 

Sponsor Ads

About Mitesh Singhal Advanced   Singhal Industries Private Limited

40 connections, 0 recommendations, 111 honor points.
Joined APSense since, February 1st, 2020, From Gandhinagar, India.

Created on Jun 2nd 2020 14:40. Viewed 344 times.


No comment, be the first to comment.
Please sign in before you comment.