How to fix Connect to database testlink error
Overview
In this tutorial, we will learn the steps to fix the following error:
Connect to database testlink on Host localhost fails
DBMS Error Message: 2002 – No connection could be made because the target machine actively refused it.
Error Indications
This error will not allow to display the expected pages on the TestLink Web instance. An Error page would be displayed instead of the TestLink expected page.
Root cause
The main cause of the error is that the MySQL database is not started and no connection has been made to the backend database.
Another possibility is that any network configurations like Firewall rules are installed so that the connections to database are refused.
Fix
Check if the MySQL database instance is running. If the database is not running. Start the instance or the service:
Example command to start the MySQL instance:
/> mysql\bin\mysqld --defaults-file=mysql\bin\my.ini --standalone
If you use XAMPP console and check if MySQL instance is running. We may need to check the error logs for any errors.
Check the firewall rules for any port blocked rules. MySQL listens on the default port number 3306.