It would help to show some code and the exact error message (by all means s/real_username/username/ s/real_password/password/ s/real_ip/x.x.x.x/ etc). The actual error message in all its exacting detail is typically relevant. Do you actually get '***', .... ? When a script runs on the command line (as user you presumbably, IP ? localhost) you need to understand that under CGI it probably runs as user ? apache ? nobody, IP ? real_ip. In other words the environment is different. It seems as though you are connecting to a remote DB which will have in it a remote access perms table that might look like:

user perms you@somewhere * you@% *

That's fine when you try to connect but not so good when apache@perhaps_some_other_ip tries to connect. If that is not the problem you also possibly have a firewall between you and the remote DB. DBs connect on unusual ports, and you can punch holes through firewalls on a global or per user basis.....

cheers

tachyon

s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print


In reply to Re: Re: Re: perl db connection problems by tachyon
in thread perl db connection problems by foobarbaz

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.