How to Fix the Error Establishing a Database Connection in WordPress? Serverhosthub – The Hosting Platform Made For You – Go Online With Hosting serverhosthub | free hosting | Linux shared hosting | Hosting | Free domain | Life time Free ssl certificate | Chepest web hosting | Low price hosting | Domain Transfer

Today in this article, we will show you how to fix database connection error in WordPress.

Error establishing database connection in wordpress

This error occurs when WordPress is unable to make a connection to the database. There are a number of things that can affect your WordPress database connection making it difficult for beginners to troubleshoot.

video tutorial– Error establishing database connection error in WordPress [SOLVED]

Error establishing database connection

The ‘Error establishing database connection’ issue can be caused by incorrect database information in your WordPress settings, a corrupt database, or an unresponsive database server.

WordPress uses a database to store all your content and other website data. After this, whenever someone visits your website, it gets connected to the database.

If any of these items are incorrect, WordPress will fail to connect to your database server, and you will see the error ‘Error establishing database connection’. This is one of the most common WordPress errors that users face.

How to Fix Error Establishing Database Connection in WordPress?

To solve this problem we need to check two things i.e. MySQL database and wp-config.php file

Below is the information that WordPress uses to connect to the database

  • database name
  • database username
  • database password
  • database server

This information is stored in your WordPress configuration file i.e. wp-config.php file. You just need to make sure that this information in wp-config.php matches that of the MySQL database.

Phase 1 login to your seapanel

Error establishing database connection in wordpress

Phase 2 go for MySQL database

Error establishing database connection in wordpress

step 3 Find your database and the user associated with it

Error establishing database connection in wordpress

Error establishing database connection in wordpress

step 4 open in a new tab file manager Sections in your cPanel

Error establishing database connection in wordpress

Step::5 click on public_html Find out more wp-config.php File (If your WordPress is installed directly in your domain otherwise go to the respective folder where you installed WordPress and look for the wp-config.php file)

Error establishing database connection in wordpress

Error establishing database connection in wordpress

Step::6 click above wp-config.php file and select Edit To see all the information like database name, database username, database password etc.

Error establishing database connection in wordpress

Step::7 Correctly match the credentials with the information you see MySQL database section

Error establishing database connection in wordpress

Step::8 change database password In the MySQL Databases section.

Error establishing database connection in wordpress

(always use password generator To generate password for higher security)

Error establishing database connection in wordpress

Step::9 Once the password is generated, copy it and paste the same password in the database password field in wp-config.php

Error establishing database connection in wordpress

Error establishing database connection in wordpress

Step::10 click on save Changes Once completed and check your website..

Error establishing database connection in wordpress

Hope your WordPress site is fixed now, congrats…

Error establishing database connection in wordpress

Thanks for reading this article!!!