I set both client and server sockets in /etc/my.cnf on all machines in an attempt to create consistency, but this doesn't help DBD one bit.

To get the MySQL client library to look at /etc/my.cnf, it is possible to provide a mysql_read_default_file parameter in the DSN. From the DBD::mysql documentation:

... can be used to read a config file like /etc/my.cnf or ~/.my.cnf. By default MySQL's C client library doesn't use any config files unlike the client programs (mysql, mysqladmin, ...) that do, but outside of the C client library. Thus you need to explicitly request reading a config file ...

I haven't tried this myself to see if it helps. As the mysql_socket parameter seems to be getting ignored, I'm in no hurry to try this.

Since I wrote the original post, I have updated DBD::mysql on my system Perl - now that one is looking at the wrong socket too. I have, therefore, been grep'ing through all my code for DBI->connect()s, adding the %ENV fix before them. Hey, could have been worse - I could have done this on one of my production servers ;-)

My guess is that the problem is somewhere in the MySQL code and that DBD::mysql is just a victim.


In reply to Re^2: YAMSP (Yet Another MySQL Socket Problem) by smiffy
in thread 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.