Click here to Skip to main content
15,881,687 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
mysqli_connect(): (HY000/2002): No connection could be made because the target machine actively refused it. in C:\xampp\htdocs\my_web_app_project\sms\db_con.php on line 3
not connected

What I have tried:

I put password in blank area of password in file config.inc.php but nothing change
Posted
Updated 27-May-20 6:56am

A connection being actively refused from a machine could be a symptom of a firewall or similar blocking the connection, or that the MySQL service isn't running on the machine.

Check to ensure that MySQL is running, and also check that PHP has an exemption to allow connection to the database. If your MySQL database is hosted remotely, there might be restrictions on which IP addresses can connect to it. If that's the case, make sure to add your IP address as an authorised connection.
 
Share this answer
 
Comments
vishal@1 27-May-20 13:29pm    
No mysql is not running
Quote:
No connection could be made because the target machine actively refused it.
You're using the wrong host name, or the wrong port, or MySQL isn't running.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900