Forum Moderators: coopster

Message Too Old, No Replies

(Not) Connecting to a remote MySQL server in PHP

Unknown MySQL server host...

         

YorkshireSteve

10:43 am on Oct 22, 2003 (gmt 0)

10+ Year Member



Hi,

Everytime I try and connect to a remote MySQL host in PHP, I get the following warning:

"Unknown MySQL server host 'db123.oneandone.co.uk'"

I also get this same error in EMS MySQL Managmer software when I try and connect to a remote server. Dreamweaver MX however, is fine with this - I just enter my database server, 'db123.oneandone.co.uk' and it connects. The one thing I have noticed though is that neither the MySQL manager or the PHP page sends any network traffic before giving me the error message.

Do I need to prefix the hostname with something, or is it a MySQL config variable that's wrong?

Surely many people have come accross this problem, but I can find nothing explaining what it is and why I'm getting it. As you can imagine, this is driving me round the bend, and I'm desperate to find the problem.

Many thanks,

Steve.

gethan

10:54 am on Oct 22, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Are you using a php script running on oneandone's web servers?

The oneandone db servers should only be accessible from hosts within the oneandone network.

Eg. >ping db123.oneandone.co.uk from your computer should result in unknown host.

I'm confused as to why Dreamweaver MX appears working for you.

YorkshireSteve

9:03 pm on Oct 22, 2003 (gmt 0)

10+ Year Member



Hi,

Thanks for the reply, gethan.

The PHP script(s) I'm trying to run work fine on the server, but not from my testing server (at home). Okay, so the host db123.oneandone.co.uk cannot be found therefore it's only accessibly from the One & One network.

For some reason, Dreamweaver did work previously, but doesn't now... It was a while ago - maybe they've tightened security...?

I guess it must just be the MySQL server that doesn't allow connections outside their network.

Steve.