[Solved] arning: mysqli_connect(): (HY000/2002): No connection could be made because the target machine actively refused it [duplicate]


Since you are using wampp. try go command line on the bin folder with mysql.exe file. Test are you able to connect to that server in the first place.

mysql -uroot -h 192.168.1.### -P 3306 -p

-uroot -u is indicate user name. root is the user name to login your mysql server. Just change the root to correct user name.

Possibility
1. Remote server did not open for remote mysql connection.
2. Remote server firewall is not open the Mysql port for remote connection.
3. You have attempt too many time with wrong password. So now your IP is been blacklist by the MySQL server itself.

solved arning: mysqli_connect(): (HY000/2002): No connection could be made because the target machine actively refused it [duplicate]