Page 1 of 1

Connecting to mysql 9.0 with php help needed...

Posted: Thu Jun 12, 2008 3:49 am
by hairytea
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)

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);
 
?>
 
 
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

Re: Connecting to mysql 9.0 with php help needed...

Posted: Thu Jun 12, 2008 3:59 am
by hairytea
Can't connect to MySQL server on 'IP_ADDRESS' (10061)


is the above line telling me it is trying to connect on port number 10061 or is 10061 an error code?

the reason i ask is that even when specifying port 3306 i still get the same error?

Re: Connecting to mysql 9.0 with php help needed...

Posted: Thu Jun 12, 2008 4:03 am
by hairytea
UPDATE

don't know if this helps.....

i have spoken to their ITguys and they have opened port 3306 on the cisci server to allow traffic and am still getting the same error message.