Reputation: 29
I am using following code to connect to remote mysql from php application I am using WAMP server where i installed my php application and on remote side also wamp server is there.
$con=mysql_connect('xxxx:xxxx:xxxx:xxxx','root','');
But connection is not being established. Following warning is coming...
Warning: mysql_connect() [function.mysql-connect]: [2002] php_network_getaddresses: getaddrinfo failed: No such host is known. (trying to connect via tcp://10:133)
Please any body give me some idea ! thanks !
Upvotes: 0
Views: 10136
Reputation: 263683
try this:
$con=mysql_connect('192.168.0.1','root','');
or if you want to specify the port:
$con=mysql_connect('192.168.0.1:3306','root','');
Upvotes: 1
Reputation: 100175
Should be dots not colons, like
$con=mysql_connect('xxxx.xxxx.xxxx.xxxx','root','');
//like
$con=mysql_connect('127.0.0.1','root','');
Upvotes: 3