Jump to content

[Solved] Problem With Mysql_connect() Function


chglove

Recommended Posts

i got an error when using mysql_connect() function, this is my code and error info:

 

<?php
$conn = mysql_connect('118.114.134.59:3307', 'test', '123456');
if (!$conn)
 echo mysql_error();
else
 echo "OK!";
?>

 

Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on '118.114.134.59' (4) in /home1/chglove/public_html/test.php on line 2

Can't connect to MySQL server on '118.114.134.59' (4)

 

but if i change the server port to 3306, mysql_connect('118.114.134.59', 'test', '123456'); it worked, and i can connect to my server use port 3307 from other sites, what's the problem?

 

you can use http://blog.chglove.tk/test.php to see this error

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...