mysql problem with socket

Ryan Schmidt ryandesign at macports.org
Sun Apr 29 14:08:14 PDT 2012


On Apr 29, 2012, at 12:33, jeff at ayendesigns.com wrote:

> That link came up non-existent, but I checked the mysql site and found the published solution about checking for the existence of the .sock file and moving it if it's in the wrong place.
> 
> So, I found that there was mysql.sock in /private/tmp, but the error indicates it's being looked for in /opt/local/var/run/mysql5, so I moved it there, and I changed the group from 'wheel' to '_mysql'.
> 
> Once moved, mysql would not start. I did a 'which -a "mysql5"' and it is in /opt/local/bin. However, moving the .sock file back to /private/tmp immediately caused mysql to start again.
> 
> So, the question is if mysql is looking for the .sock file in the port path, and the mysql process running is from the port path, why does having the socket where it's being looked for break mysql rather than allowing me to run the command line program?

Do not move a socket file. MySQL needs it to be where it put it.

For a normal MacPorts mysql5 install the socket file is supposed to be at /opt/local/var/run/mysql5/mysqld.sock.

If it's in /private/tmp instead, then you probably asked for it to be there by modifying your my.cnf file to say so. I recommend you don't do that, and instead use the socket at its default location.

It's up to you of course. You can have MySQL put the socket wherever you want. But then you also have to tell all other software that uses MySQL (php, etc) where the socket is, so it can find it.






More information about the macports-users mailing list