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.

Plugins

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.

Conclusion

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

Blogging 101: 8 Common Blogging Mistakes You Must Avoid

In addition to being a passion or hobby, starting a blog is a great way to connect with your clients, enhance the visibility of...

Comprehensive Guide to Develop Grab Clone

It is advisable to know the different stages of developing a mobile application (iOS/Android) for a Grab Clone business. Before throwing yourself into the...

How to Sleep with a Toothache While Pregnant

Pregnant women go through many health scares and ordeals to finally complete childbirth and hold their newborns. As a pregnant woman, you might face...

Tips for Enhancing Mobile Testing Efficiency and Effectiveness

Do you want to know the foolproof ways to craft an app reputation? Mobile application testing is the ultimate answer to this question. Mobile...

Recent Comments