Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Canot connect to the remote mysql server through those lines

by davidj (Priest)
on Jul 05, 2007 at 03:39 UTC ( [id://624983]=note: print w/replies, xml ) Need Help??


in reply to Canot connect to the remote mysql server through those lines

Well, the first thing I would do is see if I can connect to the database from the commandline.You know:
mysql -u root -p
Since one of the databases in on your local machine, you should have no problem. If you cannot connect that way, then it is a MySQL issue. If you can connect that way, then its an error in the script. If it is an error in the script, then I would strip it down to the absolute essentials of something like this:
#!/usr/bin/perl use DBI; use strict; my $dbh; my $db='survey'; my $host='localhost'; my $user='root'; my $pw='whatever'; $dbh = DBI->connect("DBI:mysql:$db", $user, $pw) or die "Database conn +ection not made: $DBI::errstr"; print "Woo Hoo! I connected!\n"; exit;
If that works, then I would start rebuilding the cgi script from that point.

All that being said, my guess is that it is a problem with the script since it is unlikely that both MySQL servers you are trying to reach have problems.

By the way Nik, you really need to develop some basic troubleshooting skills.

just my 2 cents,
davidj

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://624983]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (6)
As of 2024-04-24 20:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found