Database Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesDatabase Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old January 17th, 2003, 10:34 AM
bag bag is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 10 bag User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 24 sec
Reputation Power: 0
Remote MySQL connection problem

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 at all. 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 simple because it's driving me loopy. Any ideas on where to look would be appreciated.

Reply With Quote
  #2  
Old January 17th, 2003, 11:11 PM
brut brut is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 367 brut User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 m 30 sec
Reputation Power: 2
RE: Remote MySQL connection problem

Try:
Code:
$connection= mysql_connect("192.168.0.1","sqlaccess","password") or die(mysql_error()); 

Reply With Quote
  #3  
Old January 17th, 2003, 11:38 PM
bag bag is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 10 bag User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 24 sec
Reputation Power: 0
RE: Remote MySQL connection problem

Tried that.

Instant response. Return is null and it dies and no messages displayed, excluding the die of course. I also removed the die to see if that would give me more information and added echo "Return = '$connection'"

Displayed was;
Return = ''


Reply With Quote
  #4  
Old January 17th, 2003, 11:44 PM
brut brut is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 367 brut User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 m 30 sec
Reputation Power: 2
RE: Remote MySQL connection problem

How do you know it isn't connecting?

Reply With Quote
  #5  
Old January 17th, 2003, 11:46 PM
bag bag is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 10 bag User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 24 sec
Reputation Power: 0
RE: Remote MySQL connection problem

Forgot to add the sql_error within the die. Silly me! It said I had a password problem when I added it in like you suggested. Mmmm. I'll have another look at the passwords and that.

Thanks. A step forward.

Reply With Quote
  #6  
Old January 18th, 2003, 01:20 AM
bag bag is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 10 bag User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 24 sec
Reputation Power: 0
RE: Remote MySQL connection problem

Brut, Progress...... It's now working thanks for your help. Getting the error message out allowed me to sort it.

I had entered the user 'sqlaccess' and a password and used the code I have used on my remote web site which works OK. Where it failed with no displayed error message.

However, it was accessing the MySQL server from the other node 'isis' and not my client PC 'echo' which I had a different password for sqlaccess on.
The link was working but with the wrong password and with no error messages I did not have a clue.
I did not know about putting the mysql_error() in the die() and that was the way forward. I will remember that from now on.

Brut, Thanks again for your help it is much appreciated.

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesDatabase Help > Remote MySQL connection problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway