PDA

View Full Version : mysql.sock madness!




Denarius
Jun 22, 2008, 04:54 PM
Okay, I've just installed the lovely new mysql community server for leopard package x86_64 flavour. It works a treat out of the box, no problems, apart from...

in terminal, 'mysql_config --socket'
returns '/tmp/mysql.sock'
Checking in '/private/etc/my.cnf' shows:
'socket = /var/mysql/mysql.sock'
Then having done '/usr/libexec/locate.updatedb'
followed by 'locate mysql.sock'
that returns '/private/var/mysql/mysql.sock'!

In a nutshell mysql thinks its socket is in 2 different locations, neither of which is correct.

I know it's working and everything, but I'm just starting to mess around with rails, which works when I prescribe socket: /private/var/mysql/mysql.sock
in database.yml, but I'd much rather it got the correct value from mysql_config in the first place.

Any thoughts on how to get mysql to figure out where its socket actually is would be very welcome.



Cromulent
Jun 22, 2008, 05:05 PM
/var is just a symlink to /private/var in Mac OS X. They are one and the same.

/private/var is the real directory though.

For reference /tmp is a symlink to /private/tmp as well. As /etc is to /private/etc.

Denarius
Jun 22, 2008, 05:17 PM
/var is just a symlink to /private/var in Mac OS X. They are one and the same.

/private/var is the real directory though.

For reference /tmp is a symlink to /private/tmp as well. As /etc is to /private/etc.

That's useful information, thank you very much.

Incidentally, I think I've just found the answer:
tried sudo vi /usr/local/mysql/bin/mysql_config and discovered I could go through and change the socket location. So now it agrees with my.cnf

Funny one! :)