1. Home
  2. Website
  3. Wordpress
  4. WordPress: How to fix Error Establishing a Database Connection Error ?

WordPress: How to fix Error Establishing a Database Connection Error ?

This article provides you with steps to solve the infamous “Error connecting to Database” issue in WordPress. This guide give you the steps on what to check in cPanel but the same things can be checked in other Control panels.

 

 

Are you seeing the ‘Error establishing a database connection’ notice on your WordPress website? It is a fatal error that makes your WordPress website inaccessible to the users.

This error occurs when WordPress is unable to make a connection to the database. A number of things can affect your WordPress database connection which makes it a bit difficult for beginners to troubleshoot.

In this article, we will show you how to easily fix the error establishing a database connection in WordPress.

 

 

Have you checked your WordPress Database Credentials?

 

The most common reason for database connection error in WordPress is incorrect database credentials. If you have recently moved your WordPress site to a new host, then this could be the most likely reason.

Your WordPress database credentials are stored in the wp-config.php file. It is the WordPress configuration file that contains important WordPress settings including database information.

You’ll be looking for the following lines in the wp-config.php file.

1
2
3
4
5
6
7
8
9
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define( 'DB_NAME''database_name_here' );
/** MySQL database username */
Updated on March 6, 2023

Was this article helpful?

Related Articles