Jump to content

Archived

This topic is now archived and is closed to further replies.

bag

Cannot connect to remote MySQL system from within PHP.

Recommended Posts

Hi,

 

I have two NT 4 servers running on my home network, both have Apache installed, one \'asia\' has MySQL 3.23.49-max-nt-log, installed. I can connect from my main system \'echo\' to MySQL using a command window to connect via ODBC all set up several months ago via instructions in a book. All working OK (As I can see). I just lately discovered PHP and decided to add that to my Intranet to allow access to real data. To this end I updated all versions to the latest, Apache 2.0.43, and on the other server, \'isis\', I installed PHP 4.3.0. The Apache, PHP combination works OK.

 

The problem is when I come to connect to the remote DB I get nothing. It fails every time with no error message at all. I connected using the nodename \'asia\' with no joy so I tried the IP address.

$connection= mysql_connect(\"192.168.0.1\",\"sqlaccess\",\"password\");

It must connect and be rejected but I get no error nor a connection. If I try an invalid IP I get a long delay before a failure with no message again!!!.

 

It must be something simply because it\'s driving me loopy. Any ideas on where to look would be appreciated.

Share this post


Link to post
Share on other sites

:D It was suggested I add a mysql_error() into my die statement which I didn\'t know you could do. I was calling it later when it had obviously been flushed. Anyway, it told me there was a password error which I played about with until it clicked. It was accessing the MySQL server from the other node \'isis\' not my client \'echo\' and I had different passwords on access for each. Changed the password in the connection statement to the one for \'isis\' and away it went.

 

Simple but still a pain.

 

Anyway sorted now. :D

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.