How to fix the error establishing the database connection in WordPress

Here you can fix the error establishing the database connection in the WordPress site. You don’t need any programming knowledge to solve this problem.

Why do You See This Error?

There are number of reasons which causes error establishing database connection in WordPress.

  • Database server is down.
  • Incorrect database username and password in wp-config.php file.
  • High traffic to your site.
  • Corrupted database.
  • Corrupted plugin or theme.

Reboot the Server

If you have active site and suddenly got this error. You can easily solve this problem by rebooting your website server. Rebooting will fix a number of common issues. Just goto to your hosting account and click on restart or reboot option.

Check DB Username and Password

If you mis configure database username and password in wp-config.php, you will get this error.

So check your wp-config.php file. It is located root directory of your WordPress site or blog.

You can check, does your wp-config.php file has valid database name, database username and password.

// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define( 'DB_NAME', 'kits' );

/** MySQL database username */
define( 'DB_USER', 'root' );

/** MySQL database password */
define( 'DB_PASSWORD', 'password' );

/** MySQL hostname */
define( 'DB_HOST', 'localhost' );

Check Your Server Usage

If your site has high volume of traffic, you may face this error establishing database connection in wordpress. So check your server memory usage on your hosting provider dashboard.

Contact Your Hosting Provider

If above methods does not solved your problem, finally contact your hosting provider. They can easily solve this problem.

Here you can choose your hosting provider to get help.

Leave a Reply

Scroll to top