mysql.sock madness!

Discussion in 'Mac Programming' started by Denarius, Jun 22, 2008.

  1. macrumors 6502a

    Denarius

    Joined:
    Feb 5, 2008
    Location:
    Gironde, France
    #1
    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.
     
  2. macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #2
    /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.
     
  3. thread starter macrumors 6502a

    Denarius

    Joined:
    Feb 5, 2008
    Location:
    Gironde, France
    #3
    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! :)
     

Share This Page