Connecting to mysql 9.0 with php help needed...

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
hairytea
Forum Commoner
Posts: 92
Joined: Mon Feb 04, 2008 8:31 am

Connecting to mysql 9.0 with php help needed...

Post 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
hairytea
Forum Commoner
Posts: 92
Joined: Mon Feb 04, 2008 8:31 am

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

Post 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?
hairytea
Forum Commoner
Posts: 92
Joined: Mon Feb 04, 2008 8:31 am

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

Post 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.
Post Reply