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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |