Establishing a Database connection Error is the most commonly occurred error in WordPress. We no need to worried about this error, we can easily sort the error by ourselves without getting any support. In our Budget Blogging, we are going to discuss how to fix the “Establishing a Database connection Error”.
All the information on our WordPress site is stored in the SQL database. This error will occur when WordPress is not able to connect to your database. A database connection error occurred when an error in database name user name, password, host.
Check database name is correct or not. For checking open wp-config.php and open my SQL database are same or not. If it is wrong means go to wp-config.php change the database name.
define( ‘ DB_NAME’ , ‘ database name’ );
Check database username is correct or not. For checking open wp-config.php and open my SQL database are same or not. If it is wrong means go to wp-config.php change the database user name.
define( ‘ DB_USER’ , ‘ database username’ );
Check database password is correct or not. If it is wrong go to my SQL database in that go to the current user and click change password. If you need to type your password means type or click the password generator it will automatically generate the password. Copy the password and save it. Now you go to wp-config.php and set your new password.
define( ‘ DB_PASSWORD’ , ‘password ’ );
Many of the companies will use the localhost as your database host. If you are sure that your WordPress provider is using the localhost or make sure from your provider.
define( ‘ DB_HOST’ , ‘localhost’ );