Denis Barushev

Email: barushev@gmail.com

Location of the MySQL Socket File in Different Systems

From #mysql_socket_location:

"/tmp/mysql.sock", # default
"/var/run/mysqld/mysqld.sock", # debian/gentoo
"/var/tmp/mysql.sock", # freebsd
"/var/lib/mysql/mysql.sock", # fedora
"/opt/local/lib/mysql/mysql.sock", # fedora
"/opt/local/var/run/mysqld/mysqld.sock", # mac + darwinports + mysql
"/opt/local/var/run/mysql4/mysqld.sock", # mac + darwinports + mysql4
"/opt/local/var/run/mysql5/mysqld.sock", # mac + darwinports + mysql5
"/opt/lampp/var/mysql/mysql.sock" # xampp for linux

Install MySQL and mysql gem on Mac OS X Leopard

Install MySQL server via MacPorts:

sudo port install mysql5 +server

Setup the database:

sudo -u mysql mysql_install_db5

Configure MySQL to start up automatically when OS X boots:

sudo launchctl load -w /Library/LaunchDaemons/org.macports.mysql5.plist

Install mysql gem:

sudo gem install mysql -- --with-mysql-config=/opt/local/bin/mysql_config5

Source.

Socket location: /opt/local/var/run/mysql5/mysqld.sock.