Fix Error Establishing a Database Connection-3 Powerful Methods

Share it


In this topic, We are going to discuss the very important Topic How to Fix Error Establishing a Database Connection in your WordPress Website. If you are a WordPress blogger then you will definitely be facing this type of Problem at least once a time in your blogging career. So this topic help you to resolve this issue permanently from your site. Let’s start with the Topic.

Resolve Error Establishing a Database Connection in WordPress

This type of problem generally occurs and may be used in some Plugins on your Website. By using the Advance Database cleaner Plugin if you clean your unnecessary data to remove from your database sometimes Error Establishing a database connection problem shows your site.

1. By Checking Your WordPress Database Credentials

First of all, If your site has that type of Database Connection Error you have to go to the Cpanel of your website. Now you have to find out the File manager and go to the Public_html and Click on it.

Secondly, Now you need to find out the WP Config.php and after clicking on it you can see where your Database User Name and Password.

Thirdly You Open your My SQL Data Base and Compare and Match it with WP Config.php data. If your data does not match then change the wp config.php file. You have to generate or create a new password from My SQL Database and update it in the Wp Config.php file.

Finally, Save it and refresh your page after doing this process.

If you do this above mention process in most of the cases Fix Error Establishing a database connection in WordPress Website may be solved.

2. Repair Your WordPress Database

The Second Method If your website facing an error establishing a database connection in WordPress and showing one or more database tables are unavailable. In that case, you may try to repair your database.

For Repair your database you have copied this code from below and pasted it to the wp-config.php file and save it. After saving this code refresh your WordPress site, now you have to see here two different options one is Repair Database the other is the Repair and Optimize database. 

define('WP_ALLOW_REPAIR', true);

You can choose any option from two options but you have to check the first repair database option. If you click one of the options, you have to see the instruction to remove the code from wp. config.php most probably problem error establishing a database connection solved.

3. Apply Backup Database in WordPress Website

If your Database Connection Problem is not fixed above two methods, you can try this Backup method to fix the error establishing a database connection. In this method, you can use your backup Database and from your hosting site by restoring it.

But In this process, If you published any post after a backup of the Database you can not see it after restoring the Database. If you failed the above two mentioned steps but you keep this database or what number of posts are available before the Backup of your database be safe. Then you have to follow this step for fixing this error establishing a database connection of your website.

Note:- Above these 3 methods if your site database connection problem is not solved then you definitely Check your Database Server. Is this server down or not?


So above the 3 Methods, you can fix your Error Establishing a Database connection issue in your WordPress site Permanently. I think this Article may help or solve your issue. If you like this topic then definitely share this content.

Read More: