I replied to a post recently where the OP was unable to connect to a MySQL database because the DBD module was looking at the wrong socket. (Seems to be the default behaviour ;-)) At the time, I gave two solutions: one was to put a mysql_socket parameter in the connect string, the other was to set $ENV{MYSQL_UNIX_PORT}.

I have to report that I am unable to get the first method to work, more times than not - setting %ENV works every time.

As yet, I have been unable to see any rhyme nor reason for when the parameter method works or not. As I'm dealing with 4 machines, each with 2 different Perl versions, I simply don't have time to perform exhaustive tests. I do know that the parameter method is failing on this machine at this time - Perl 5.10.0 with a fresh Bundle::DBD::mysql installed from the CPAN shell.

Whilst this is not an issue for me - because I can use the %ENV method - it would be nice if anyone can throw any light on this, if for no other reason than a documented method not working.


In reply to YAMSP (Yet Another MySQL Socket Problem) by smiffy

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.