#!/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.


In reply to DBD-mysqlpp can't connect remotely by Massyn

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.