Connecting to mysql 9.0 with php help needed...
Posted: Thu Jun 12, 2008 3:49 am
Hi all,
I have been asked to get a connection to a remote server to be able to connect to database and retrieve data etc...
When i use mysql_connect i get the following error returned ...
(i have removed the ip address etc)
Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on 'IP_ADDRESS' (10061) in e:\domains\i\XXX.co.uk\user\htdocs\cgi-bin\connect.php on line 3
Could not connect: Can't connect to MySQL server on 'IP_ADDRESS' (10061)
(i have removed the ip address user name and password from my php code below)
Any ideas why i am getting this error?
I have the correct user name and password (as my client has a GUI using the same details to connect that i have seen connect)!
Could someone tell me a default port numer to add to the string maybe? I have tried 3306!
Many thanks in advance
Andrew
I have been asked to get a connection to a remote server to be able to connect to database and retrieve data etc...
When i use mysql_connect i get the following error returned ...
(i have removed the ip address etc)
Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on 'IP_ADDRESS' (10061) in e:\domains\i\XXX.co.uk\user\htdocs\cgi-bin\connect.php on line 3
Could not connect: Can't connect to MySQL server on 'IP_ADDRESS' (10061)
(i have removed the ip address user name and password from my php code below)
Code: Select all
<?php
$link = mysql_connect('IP_ADDRESS:3306', 'USERNAME', 'PASSWORD');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($link);
?>
I have the correct user name and password (as my client has a GUI using the same details to connect that i have seen connect)!
Could someone tell me a default port numer to add to the string maybe? I have tried 3306!
Many thanks in advance
Andrew