My server IP is '11.0.0.17' (local), with APACHE, PHP, MYSQL
I use following php script for mysql connection:
<?php
//$link = mysql_connect('localhost', 'test', 'password');
$link = mysql_connect('11.0.0.17', 'test', 'password');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($link);
?>
I use mysql_connect, with real IP, prepare for Remote connection, but it seem slow
- If I use command: $link = mysql_connect('localhost', 'test', 'password'); ---> connect very fast, complete immediately!
- But when I use command: $link = mysql_connect('11.0.0.17', 'test', 'password'); ---> connection completed in about 5 seconds. --> very SLOW. (Press F5 to refresh is also slow!)
I also use mysql_pconnect to replace, but it's the same!
How to make connection faster with real IP ?
I need solution for Real IP (remote connection)!
Thanks very much!