Massyn has asked for the wisdom of the Perl Monks concerning the following question:
#!/fellow/monks.pl
I love PPM with ActiveState Perl. Just the idea of saying "install dbd-mysqlpp" and it's all done. That's why I loaded ActiveState 5.8.0 on my Redhat box...
My DBI-DBD app to MySQL is working fine on my Linux machine, where I'm running mySQL and my CGI's on, however, when I try to run my CGI on another web server accessing the database across the network, all the wheels fall off.
$mwsdbh = DBI->connect("DBI:mysqlPP:database=$db;host=$server;port=$po +rt", $user, $passwd)
On my local machine (without the port=$port bit), I set $server to 'localhost', and everything works fine, because it uses /tmp/mysql.sock to do the communication, however, when I specify $port=3306 and $server=192.168.0.2 (my Linux IP), I get this error..
[Thu Dec 12 10:04:43 2002] [error] [client 192.168.0.127] script not f +ound or unable to stat: /home/httpd/cgi-bin/debugmwslib.pl DBI->connect(database=mwsdb;host=192.168.0.2;port=3306) failed: Timeou +t of authentication at /usr/local/ActivePerl-5.8/lib/site_perl/5.8.0/ +DBD/mysqlPP.pm line 109 at mwslib.pl line 1143 Can't call method "prepare" on an undefined value at mwslib.pl line 97 +5. Compilation failed in require at /home/httpd/cgi-bin/mws/debugmwslib.p +l line 4.
I've done a telnet to 192.168.0.2:3306, and it works, so the port is active. Any idea what I'm doing wrong? I'll need this to split the database and webserver to different hardware.
Thanks!
#!/massyn.pl
You never know important a backup is until the day you need it.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: DBD-mysqlpp can't connect remotely
by rdfield (Priest) on Dec 12, 2002 at 09:19 UTC | |
by Massyn (Hermit) on Dec 14, 2002 at 20:19 UTC |