How To Quick-Fix The Error Establishing A Database Connection WordPress?

Being a WordPress website developer, the situation can be too much terrible for you when you are suddenly unable to access your site for any reason. You can be sometimes preventing from being accessing your WordPress website just because of the Error Establishing A Database Connection WordPressThis is the most common as well as a serious problem most users come up-front usually when WordPress is not able to make a proper connection to the database.

A number of important things can get affected if the connection is lost between WordPress and Database. That’s why; it is required to immediately take an action for solving the error by establishing a database connection in WordPress. In this guide, you will learn the right ways to fix the error. Thus, read it out!

Possible Reasons For The Error Establishing A Database Connection WordPress

There can be a handful of reasons due to which the ‘Error Establishing A Database Connection In WordPress’ occurs. Some of them are listed underneath, check-them out by giving a glance:

  • Wrong database details in your WordPress Settings.
  • Using the corrupted WordPress files could also trigger such a database connection error.
  • Because of the corrupted database.
  • When the database server is down, then also such an error arises.
  • If there is too much traffic on your Website.

WordPress Requires the Following Information To Connect With Database:

  • Name.
  • Username.
  • Password.
  • Server.

Solutions To Quick-Fix The Error Establishing A Database Connection WordPress

Since we value your precious time, that’s why without any delay we are going to describe the effectual solutions in the below so that you can in the pinch fix the Error Establishing A Database Connection. Let’s take a brief look at once and follow the provided directives in an appropriate manner:

Solution 1: Check Your Database Login Credentials

Login Credentials

WordPress is one of the prominent open-source content management systems usually uses a database to store all your productive content and other website detail. Though, it is also the fact that for making a connection to the database, the correct login credentials are highly required.

Therefore, if you enter an incorrect either database username or password, the Error Establishing A Database Connection will definitely arise. This is the reason why we suggest you here to first check your database details like your name, username, and password, and database host for 100% correctly inserted. However, you can confirm all this information directly from your WordPress hosting account dashboard. Here is what to do:

  • You just have to log in to your hosting account
  • Then, select the “Databases” option from the left-panel
  • Now, give a single click on “MySQL Databases” link.
  • You will be then directly landed to the database management page. From there, you can find out your database name and the username.
  • And then you will find the database users and links to change the password.
  • You can anytime change the database information in your wp-config.php file whenever it is required.
  • Afterward, visit your WordPress website to check if the Database Connection Error has solved.

If you still see the same error, then this means something else is wrong. Continue reading to find the next solving guide.

Solution 2: Check Your Database Host Information


If it is confirmed by your end that the complete information related to database is correct, then in the next you also have to make sure that you are using the correct database host information. Numerous WordPress hosting companies use localhost as your database host.

However, some managed WordPress hosting companies use specific servers to host databases. In such condition, your database host information will not be localhost. For that, you should contact your WordPress hosting company to ensure about your database host information.

Solution 3: Check If Database Server Is Down

Database Server

If everything seems to be correct but unfortunately still facing the Error Establishing A Database Connection WordPress, then this time most probably your database server (MySQL server) is down. This could happen most of the time because of heavy traffic on a server.

Generally, your host server cannot handle the load specifically the time when you are on shared hosting. Your site will really go slow and for some users it may even result the database connection error. Therefore the best thing you should do is get on the phone or live chat with your hosting provider and urge them for your MySQL server to be responsive.

Solution 4: Update WordPress Site URL

WordPress Site URL

Another possible solution you are suggested to do is try updating the WordPress site URL using phpMyAdmin. Here is how:

  • Simply access phpMyAdmin from your hosting account dashboard, and select your WordPress database to check the URL for update.
  • Afterward, place a click on the “SQL” menu on the top and enter the following MySQL query. UPDATE wp_options SET option_value=’YOUR_SITE_URL’ WHERE option_name=’siteurl’

Never ever forget to mention your own site URL and change wp_options to your own table name as you may have changed the WordPress table prefix. If now you are able to connect the database, the problem has resolved. But if yet won’t connect, continue fixing using the next solving guide.

Solution 5: Rebooting Web Server

Rebooting Web Server

Users on dedicated servers, local servers, and virtual private servers (VPS) can simply try rebooting their Web servers. This will soon restart your web and database server which may fix some temporary glitches including the Error Establishing A Database Connection.

Contact WordPress Support Team To Quick-Fix Database Connection Error

We hope this guide helps in solving the Error Establishing A Database Connection WordPress.  If in case the error is yet persisting, feel free to reach us via 24/7 Online WordPress Support Number. We are a team of highly proficient and well-educated engineers who know better how to deal with customers’ queries. Thus, with no confusion connect with us and get your problem solved in just a second.