It would seem that way, but something strange is going on...

When the CGI connects to mySQL on the same box via /tmp/mysql.sock, the script works fine. When I change it to connect via port 3306, I get this error.

Now you showed me something interesting... The problem in /home/httpd/cgi-bin/debugmwslib.pl. This is not the script location -- it is /home/httpd/cgi-bin/mws/debugmwslib.pl, and it is the same location where I run it from (eg. http://192.168.0.2/cgi-bin/mws/debugmwslib.pl). </home/httpd/cgi-bin/debugmwslib.pl

I do not have any redirection HTML code.

Here's the script output when I run it from the command line (trying port 3306)

root@morpheus:/home/httpd/cgi-bin/mws# ./debugmwslib.pl Content-type: text/html DBI->connect(database=mwsdb;host=192.168.0.2) failed: Timeout of authe +ntication at /usr/local/ActivePerl-5.8/lib/site_perl/5.8.0/DBD/mysqlP +P.pm line 109 at mwslib.pl line 1145 <html> <link REL="STYLESHEET" TYPE="text/css" HREF="/mwsstyle.css"> <head> <META HTTP-EQUIV="Expires" CONTENT="Tue, 2 Jan 1996 12:00:00 GMT"> <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> <META HTTP-EQUIV="Cache-Control" CONTENT="no-cache"> </head> <h1>Massyn Web Security</h1> Can't call method "prepare" on an undefined value at mwslib.pl line 97 +7. Compilation failed in require at ./debugmwslib.pl line 4. root@morpheus:/home/httpd/cgi-bin/mws#

As said previously, when I connect to "localhost", everything works fine. I'm really confused why this is happening, and I really need to split the database and web server components.

Thanks!

#!/massyn.pl The more I learn, the more I realize I don't know. Albert Einstein 1879-1955


In reply to Re: Re: DBD-mysqlpp can't connect remotely by Massyn
in thread 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.