I use Mysql-h 192.168.7.14-uroot-proot-d sheep on the web host to connect to the remote database to see the data inside.
But the same server with PHP to connect unexpectedly failed.
Directly on the output "wrong while connect db!", the port can not be removed, not the constant directly written in the Mysql_connect parameter. I've shut down the firewall, and the web directory is the root owner and the group.
What else is there to be?
Reply to discussion (solution)
You change the die ("wrong while connect db!") to
Die (Mysql_error ())
No 3306 ports are specified.
You change the die ("wrong while connect db!") to
Die (Mysql_error ())
Output can ' t connect to MySQL server on ' 192.168.7.14 ' (13)
No 3306 ports are specified. Not specifying a port.
Pay the program with the server on the same server to use localhost directly
Echo Phpinfo (); see if the MySQL extension is normal.
Echo Phpinfo (); see if the MySQL extension is normal. It's a lot of output, almost normal.
Execute Setenforce 0, you can do it.
http://yemaosheng.com/?p=191
But I don't understand why, let's do it.
You change the die ("wrong while connect db!") to
Die (Mysql_error ())
Output can ' t connect to MySQL server on ' 192.168.7.14 ' (13)
The firewall intercepts requests that are accessed from outside.
Turn off the firewall.