WordPress Database Connection Error – Error Establishing a Database Connection

Can’t Login To WordPress Dashboard
June 6, 2021
Contact Form 7 Errors and Solutions
October 12, 2021
Show all

WordPress Database Connection Error – Error Establishing a Database Connection

WordPress Database Connection Error or Error establishing a database connection
In this article we will cover what are the reasons for wordpress database connection error along with 5 simple and easy solutions to fix WordPress Database Connection Errors

Can’t access your wordpress website due to Wordpress Database Connection Error - Error establishing a database connection is really really frustrating and we completely understand this situation. But you need not to worry for this anymore, In 99% cases this is a fixable issue unless your database is still present and secured on your web-hosting server. So Let's start - Here we go.

5 Very Common Reasons for a WordPress Database Connection issues are as below

1). Incorrect Database Connection Credentials

2). Non-Compatible PHP Version of your website.

3). Wordpress Database Directories Corruption or deprecation issue

4). Any Third Party Plugin Restrictions.

5). Web Hosting Server Issues.


Lets get started now and before you do that make sure you are working in google chrome or in mozilla firefox browsers only.

1). Incorrect Database Login Credentials

This is the most common reason due to which you might getting WordPress Database Connection Error

Sometimes just a sinle string, dot, comma, capital or small letter mistyping causes this error

If your WP Database still exists - you can easily fix this issue by replacing the correct login credentials for your WordPress database.


Here are the steps to check and correct your WP Database Connection Login Credentials.

1). Login into your web hosting cpanel.

2). Go to mysql database

3). Check the DB name, DB Username and DB Password and make a note of all that with you.

4). Now go to file manager

5). Open wp-config file

6). Now match the DB name, DB username and DB Password here.

7). If its different then paste the correct one you collected from mysql databases - if its already same then skip this step and lets move forward to other possible reason.

2). Non-Compatible PHP Version of your website.

This is another very common reason for getting WordPress Database Connection error. Mysql Database runs with the support of PHP which means a compatible php version should be configured and installed for your wordpress website as well as for your MySql Database server in your web hosting cpanel.

To figure this out you need to login into your web hosting cpanel and check the current php version under php multi manager but if you have zero experience in working with php then we don't recommend you to try this yourself because that way you may destroy all mysql database directories which will result into a complete non-working destroyed website of yours.

In this situation we recommend you to get this checked and fixed with the help of an Official WordPress Expert. You can call us on our WordPress Customer Service Phone Number on +1-917-300-0312 and get it fixed with the help of one of our WordPress Experts on a one time nominal fee.

3). WordPress Database Directories Corruption or Deprecation issue

If you have checked / applied the first two steps and still the WordPress Database Connection error issue is not resolved or fixed and you are still getting Error Establishing Database Connection on your website, that means there is a possibility of database directories corruption or Deprecation.

Above 80% of WordPress Users are not aware of this fact that the plugins you download and install in your wordpress dashboard are from third party providers and everytime you install a plugin you need to make sure that the plugin you are going to install should be compatible with your wordpress version - which shows up with every plugin in three different statements.

1). This plugin is compatible with your wordpress version.

2). This plugin is non-compatible with your wordpress version.

1). This plugin is untested with your wordpress version.

The thumb rule is - you should only install the compatible plugins in your WordPress Dashboard.

Now once a non-compatible plugin is installed in your dashboard that may corrupt your wordpress website database directories anytime from 1 day to 6 months time based on the number of non-compatibility error logs occurred with the time. Now this is a crucial issue which requires coding knowledge and php variables understandings. If you know all this you are good to go, else you should only get this done by an Official WordPress Help and Support Expert. You can call us on our 24/7 WordPress Customer Support Phone Number on +1-917-300-0312 and get it fixed with the help of one of our WordPress Experts on a one time nominal wordpress expert fee applicable.

4). Third Party Plugin Restrictions

There are several Third Party Plugins which restricts the database connections to work and authenticated properly.

To figure this out you can login into your ftp account and disable all plugins but renaming the plugin names and before you do that make sure to make a note of all original names of your plugin folders so that you should be able to rename back with the original ones after troubleshooting. If you have zero experience in working with ftp folders - we don't recommend you to try this yourself because that way you may destroy some other directories of your website too.

In this situation we recommend you to get this checked and fixed with the help of an Official WordPress Expert only. You can call us on our Official WordPress Support Phone Number on +1-917-300-0312 and get it fixed with the help of one of our In house WordPress Experts on a one time nominal fee.

5). Web Hosting Server Issues

Now when you have figured out all the above reasons and troubleshooting steps and still your WordPress Database Connection Issue has not resolved yet - then the only possibility left our is your web hosting server configurations.

To figure this out you need to call to your web hosting service provider and ask them to check the possible reasons of the issue. If they are able to figure this out and fix that (success ratio is 50%) for you - you are done. If not you can call us on our Official WordPress Support Phone Number on +1-917-300-0312 and get it fixed with the help of one of our In house WordPress Experts on a one time nominal fee.