bag Posted January 12, 2003 Share Posted January 12, 2003 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. Quote Link to comment https://forums.phpfreaks.com/topic/39-cannot-connect-to-remote-mysql-system-from-within-php/ Share on other sites More sharing options...
bag Posted January 18, 2003 Author Share Posted January 18, 2003 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. Quote Link to comment https://forums.phpfreaks.com/topic/39-cannot-connect-to-remote-mysql-system-from-within-php/#findComment-168 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.