Saturday, 15 March 2014

remote access - Can't connect to MySQL server on 'ipaddress' (4) (2003) -



remote access - Can't connect to MySQL server on 'ipaddress' (4) (2003) -

$mysql_host = "myipaddress"; $mysql_user = "user"; $mysql_pass = "password"; $mysql_db = "mydb"; $con = mysqli_connect($mysql_host, $mysql_user, $mysql_pass, $mysql_db); // check connection if(mysqli_connect_errno()) { echo "failed connect mysql: " . mysqli_connect_errno() ." ". mysqli_connect_error(); }

i utilize phpstorm , using same configurations (ipaddress not localhost) connects database (database on local system; phpmyadmin).

i using phpmyadmin locally. can connect using interface , local host fine well. in phpstorm set local , remote connection. local using localhost, , remote using systems outside-world ip address. can access db using both methods within phpstorm.

however when set above code in php doc , run on remote server access local db same way have phpstorm doing it, error.

when seek ping 3306 via telnet (win7) gabled text , "got packets out of order .. connection host lost." 1 time again using same info can connect using phpstorm. whats this?

well, there several things may want check.

most firewall filtering outside connections port 3306. phpstorm , phpmyadmin connects fine, cause running on same machine. check if mysql server listening connection on real ip. might hear on localhost. if behind router, need port forwards 3306 actual machine running mysql server.

mysql remote-access

No comments:

Post a Comment