Monday, February 26, 2024
Home Technology How to Fix the Error Establishing a Database Connection in WordPress

How to Fix the Error Establishing a Database Connection in WordPress

Among the common errors on WordPress, the Error Establishing Database Connection (EEDC) is an error that comes up most frequently.

While there are plenty of solutions to this error, the problem with this error lies in its diagnosis. If it does occur, you don’t know what caused it since there are multiple factors at play.

This also adds to its uniqueness since the EEDC you get might be due to a faulty plugin or theme. To another user, it could be due to corrupted files. Regardless, we want to troubleshoot and fix it and, in this article, we’ll do just that!

The following post discusses three ways in which you can quickly fix the WordPress EEDC. Using these three ways, hopefully, will put you in the right direction in solving this error for your WordPress site.

So, let’s begin.

Explaining Database Connection Errors

The WordPress EEDC, unlike the more complicated errors, is easy to identify.

Explaining Database Connection ErrorsThis is what it essentially looks like when you access your website.

From the outset, it looks as though the error is a disconnect between the database and the server. While that may be the case for some, but for others, it might not be so.

The end-goal, whenever this error occurs, is to troubleshoot as quickly as possible.

Here’s how you can do so.

Fixing the WordPress Error Establishing Database Connection (EEDC)

At the fundamental level of fixing these WordPress Errors, you need to ensure whether or not you’re using the correct credentials. Try and log-in to your website with the right WordPress credentials.

If you’re still facing the error, then the problem lies deeper. It could be either in the WordPress core, the plugin/themes, or any other area. Here’s how you can fix the issue.

Back-Up Your Website Through the Backend

WordPress experts across the board agree that backing up your WordPress site can prove beneficial.

It’s always best to keep your site backed up in the event of something going wrong. Ideally, your backup copy should include a recent WordPress version as well as the database files. If your site gets compromised, you can restore it to the current version.

But here’s the problem: you can’t access your website through the /wp-admin. Now what?

The solution to this problem lies in the cPanel or the backend control panel provided by your hosting provider. Using it, you can restore and backup your website.

cPanelIf you can access the cPanel, then you can back up your WordPress website through it with ease.

Deactivate or Delete Corrupted WordPress Themes and Plugins

Because of updates and general incompatibility issues, your WordPress themes and plugins get corrupted. Because of this conflict, you face the EEDC on WordPress. Even while you’re following up on keeping your plugins updated and maintained, this error can occur.

How do you fix such an error?

Just like the first step, you need to work through the backend to troubleshoot and resolve it. A file manager like FileZilla can prove very beneficial with this since it allows you to access all your WordPress files directly from the backend.

When you’ve connected your FTP, it’s now time you move from folder to folder and navigate to the wp-content folder. From there, find the plugins and themes folder.

All you have to do once you’ve found the wp-content folder is to rename a file called Plugins to Plugins.old.

All your plugins will be deactivated once you’ve done that.


Now what you have to do is try and access your website through the wp-admin. If you get successful access to the website, go back to your FTP. From there, change the Plugins.old folder to Plugins again.

Now, log in to your website again and from the WordPress dashboard, navigate to the Plugins section and then activate each plugin step by step. At the same time, keep logging in and out to see whether the EEDC is showing.

For example, after the second plugin, you get an EEDC. Now what you do is visit the FTP and disable the plugins through the steps as explained above. Now, log back into your website and delete the second plugin that caused this issue to arise in the first place.

Now, if you’ve done everything and the issue persists, it’s time you look at your WordPress theme and see what’s causing the problem.

The process is more or less similar to the plugins. The only difference is that from the wp-content folder within the FTP; you need to search for the themes folder.

Plugins2Now, don’t change the name of the theme folder. Instead, look at the active theme on your site and rename to disable it. It reverts your WordPress to the default WordPress theme.

Log in to your website again. If this was the actual cause of the error, fixing it would allow you to log in. The front-end of your website will now show the default theme instead of the one you customized.

Once you feel as though your website is loading well, it’s time you reinstall your WordPress theme. Now, you will have to revamp all your previous settings which will take some time but it’s better than having nothing at all.

Once you’ve reinstalled the theme, you should also send an error report to the developers of the theme. This helps other developers avoid problems in the future.

Reinstall the WordPress Core

When the steps mentioned above don’t work, it’s time you move on and replace your original WordPress core with a fresh installation.

This should always be taken as a last resort since messing around with the WordPress core can make things even more complicated if you don’t do things right.

First of all, visit the official WordPress Website to install a fresh version of WordPress.

On your computer, extract the file. Now access the folder and remove the wp-content folder. It prevents the chances of content duplication and overwriting when you’re replacing files within the FTP.

Now, start up your FTP and access your WordPress files. Within the root folder, you can upload the installation from your computer to the directory.

When you start dragging and dropping files in such a manner, the FTP will ask whether you want to overwrite the files already. Just overwrite and replace the original files with newer, fresher versions of the files.

Now, log in to your website again to see whether the changes made have worked. Nine times out of ten, such a last resort trick fixes the issue.

Nothing Worked? Here’s what to do next.

When all else fails, and you’re at a wits-end on what to do, the last thing you can do is contact your hosting provider or hire a WordPress Development Expert to debug and solve this issue. We recommend the former since they’re the ones from whom you purchased the product.

Your hosting provider will debug and resolve everything for you in the most efficient manner. Moreover, they will also provide you with a log of what caused the issue in the first place.


No website can run without a database. Your browser is bound to return an error when it finds a disconnect between WordPress and database.

In this post, we discussed the three ways in which you can fix the WordPress EEDC. Hopefully, after reading this article, you were able to solve the error. If not, then the last suggestion can hopefully fix it from the backend.

To review, we talked about three ways through which you can remove the EEDC:

  • Back-Up Your Website Through the Backend
  • Deactivate or Delete Corrupted WordPress Themes and Plugins
  • Reinstall the WordPress Core.

We hope you enjoyed reading and got informed today!

Ana Hoffman
Anna Hoffman is a part-time blogger who writes on Business, Technology, Digital Marketing, Real Estate, Lifestyle, and Educational topics.
- Advertisment -

Most Popular

WooCommerce vs Magento- Which platform is best for eCommerce web development in 2024?

WooCommerce and Magento both are the best players in the realm of eCommerce website development, and therefore it is not easy to choose the...

Tips for Starting an Engineering Firm in Texas

Starting an engineering firm in the vast and diverse state of Texas can be a thrilling venture for those with the vision and determination...

Unlocking Timeless Beauty: The Perfect Harmony of Morpheus8, Botox, and Fillers

In the ever-evolving world of aesthetics, the pursuit of timeless beauty is an enchanting journey. Picture this: you stroll into a chic clinic, the...

Do Purple Eyes Exist? 5 Potential Causes

The concept of purple eyes has long imprisoned the inventiveness of people around the world. But are purple eyes an authenticity, or just a...

Recent Comments