Well, I can tell you that "10061" is "Connection refused" under WinSock (the Windows Socket layer, a.k.a. TCP/IP for Win32). Based on "host=localhost;port=80", this almost always means that there is nothing that is listening to port 80 of localhost. Port 80 is usually used by the web server. Is MySQL really using that port number on the same computer as your web server is running on (that just seems strange to me)?

Mostly FYI, a common misunderstanding about TCP/IP is that people don't realize that a server process can listen not just to a port number but also to a specific combination of address and port number. So a common mistake with TCP/IP servers is to have the server specify which address it is to be contacted at rather than specifying only the port number (that is, specifying an address of INADDR_ANY). So it is possible to have a server process that can be contacted when you use its name (or IP address) but that will give "connection refused" if you try to access it as "localhost".

I don't see any smoking guns for the particular error that you are getting, but I'll mention a couple more things that seem strange.

($0 =~ m,(.*)/[^/]+,) && unshift (@INC, "$1"); ($0 =~ m,(.*)\\[^\\]+,) && unshift (@INC, "$1");
since that code happens at run time, it won't have any effect on any subsequent use statements (which happen at compile time). It could change where subsequent require statements look for modules, but that code is followed only by use statements, not require statements, so it is useless in this snippet.

Also, one difference between mod_perl and the other situations you mentioned is that the run-time pass happens over and over via some trickery about putting all of your code inside of a sub. So this probably means that in mod_perl the above code actually gets run over and over again and @INC gets very, very full.

So you should really but that code inside a BEGIN block.

I thought one of the big points of mod_perl was that you could intelligently cache and reuse your DBI connections, saving lots of time-consuming reconnecting for every single page hit. I suggest you look into an appropriate module for doing that.

        - tye (but my friends call me "Tye")

In reply to (tye)Re: mod_perl breaks MySQL connectivity... by tye
in thread mod_perl breaks MySQL connectivity... by Anonymous Monk

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.