Today in this article, we will show you how to fix database connection error 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
Phase 2 go for MySQL database
step 3 Find your database and the user associated with it
step 4 open in a new tab file manager Sections in your cPanel
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)
Step::6 click above wp-config.php file and select Edit To see all the information like database name, database username, database password etc.
Step::7 Correctly match the credentials with the information you see MySQL database section
Step::8 change database password In the MySQL Databases section.
(always use password generator To generate password for higher security)
Step::9 Once the password is generated, copy it and paste the same password in the database password field in wp-config.php
Step::10 click on save Changes Once completed and check your website..
Hope your WordPress site is fixed now, congrats…
Thanks for reading this article!!!