Getting a database connection error can be a scary thing to see on your website. It means that a program running on your site is not able to communicate with the MySQL database service to retrieve data. There are two main reasons for getting this error, either the program itself is not connecting properly due to login credentials mismatch from the program's configuration files, or the MySQL service is currently not running on the server. Below are instructions on how to check both.
If you have recently installed your program or changed the configuration options in the program, you will want to recheck to ensure the configuration files match what the database is expecting. The credentials you will need to know are the database name, host, database user name, and the database password.
First you will want to find these credentials in your program's configuration files. Be sure to write down all the database credentials you find as you will need to check them against the server.
Once you have the credentials from the connecting program, you will need to check them against the server to make sure they are the same. The steps below will guide you on doing that.
Databases category and click on the MySQL Databases icon.If you have confirmed the credentials and are still getting the error, or the program was working and the database connection error suddenly began, it is possible the MySQL service is not running on the server at the moment. You can test this by running a test with something called Telnet. Telnet is a network protocol that you can use to connect to the server directly and check the service availability. Below are the steps to running a test with Telnet.
telnet example.com 3306
5.1.66-c115btB+Q...If the MySQL service is not running, you will receive an error as below:
Connecting to example.com...Could not open connection to the host, on port 3306: Connect failed.
If you receive the connection failed error, the likely causes of service unavailability are either a temporary high load on the server, or the service is being restarted by the Systems Administration team. This should clear up within a few minutes. If you receive the connection confirmation and are still receiving the error, you will want to contact our support team for further assistance.