in reply to YAMSP (Yet Another MySQL Socket Problem)

I don't know why it's not working, but I do know that sockets are used by many clients, and that it programs get run on different machines where a different socket is used.

Therefore, I'd prefer to use a mysql_socket setting to be set in /etc/my.cnf, instead of configuring it for every client.

I've yet to encounter a problem with setting this in /etc/my.cnf.

  • Comment on Re: YAMSP (Yet Another MySQL Socket Problem)

Replies are listed 'Best First'.
Re^2: YAMSP (Yet Another MySQL Socket Problem)
by smiffy (Pilgrim) on Oct 12, 2008 at 00:20 UTC

    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.