Need our help to fix the issue for just 20$ ? Buy an hour Now
If you are getting “Error establishing a database connection” the first thing you need to check is if MySQL is up. If MySQL server is not up please follow this link to troubleshoot it The MySQL® server is currently offline
If it is up and running fine the problem is with the MySQL credentials.
If you have ssh access you can check MySQL credentials using the below steps from command line.
Suppose that your database details are
You can check from command line as below.
[email protected] [~]# mysql -u iservers_user -p'testpass'
Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 466965 Server version: 5.5.36-cll MySQL Community Server (GPL)
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | iservers_db | +--------------------+ 2 rows in set (0.00 sec)
In the above example you can see that we have logged into MySQL from command line using the mentioned credentials “show databases” its showing the right database.
If you are already using right database credentials you need to make sure that the credentials are same in your website config file.
For example WordPress credentials are saved in wp-config.php
/** The name of the database for WordPress */
/** MySQL database username */
/** MySQL database password */
/** MySQL hostname */
Once these things are corrected the error will be disappeared
Monthly server support with Unlimited tickets, 24×7 monitoring, Security Audit and lot more for just $59