In addition to those on the internet Baidu, my machine has this error
I need to use PHP remote connection to MySQL, the target machine has given the client permissions, but still occurs "because the target computer actively refused to connect" error
MySQL that connects to the target machine directly on the client computer is error is can ' t connect to MySQL server on ' *.*.*.* ' (111)
Using NETSTAT-TANP to view the open port after the discovery of the 3306 port is the MySQL listening port can only listen to 127.0.0.1, that is, this machine, so suspect is the port monitoring problem, in fact, has been suspected of a firewall problem, in fact, the firewall did not open
Proto recv-q send-q Local address Foreign address State Pid/program Name
TCP 0 0 0.0.0.0:80 0.0.0.0:* LISTEN-
TCP 0 0 0.0.0.0:22 0.0.0.0:* LISTEN-
TCP 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN-
TCP 0 192 192.168.1.117:22 192.168.1.100:4674 established-
TCP6 0 0::: $:::* LISTEN
Http://www.2cto.com/database/201204/127400.html
After viewing this blog post, locate the MySQL configuration file my.cnf, modify the bind-address = IP of the target machine in the LAN, and then restart the MySQL service, success!
After modifying, run the NETSTAT-TANP command as follows
Proto recv-q send-q Local address Foreign address State Pid/program Name
TCP 0 0 0.0.0.0:80 0.0.0.0:* LISTEN-
TCP 0 0 0.0.0.0:22 0.0.0.0:* LISTEN-
TCP 0 0 192.168.1.117:3306 0.0.0.0:* LISTEN-
TCP 0 0 192.168.1.117:22 192.168.1.100:4674 established-
TCP6 0 0::::::* LISTEN-
Acknowledgements: http://www.2cto.com/database/201204/127400.html
PHP MySQL failed to connect due to a target computer being actively rejected