I just had to re-install mysql and I am having a problem starting it up. It cannot find the socket (mysql.sock). The problem is that neither can I. In my Mac OS X 10.4 te
$ mysqladmin variables | grep sock
Try this instead, this will output the demanded result, getting rid of unrelated info.
I can't help with question #1, but to refresh locate
's file database, run:
updatedb
Unfortunately none of the above have worked in my case. But finally I found solutions.
To find where is mysql.sock file, simply open xampp manager, select MySQL and click on Configure on the right. On the config panel click Open Conf File, and simply search for mysql.sock by pressing the CMD+F shortcut.
In my case, the owner of the mysql.sock was changed, and I had to change it back to root admin with: chmod root:admin mysql.sock
After that the database had been accessed.
(Q1) How can I find the socket file?
The default location for the socket file is /tmp/mysql.sock, to find the socket file for your system use this.
mysqladmin variables | grep socket
If you have just installed MySql the mysql.sock file will not be created until the server is started. Use this command to start it.
sudo launchctl load -F /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist
If prompted for a password you can pass the username root or other username like this. Terminal will prompt you for the password.
mysqladmin --user root --password variables | grep socket
(Q2) How can I refresh locate index
Refresh the locate db with this command.
sudo /usr/libexec/locate.updatedb
This found it for me:
netstat -ln | grep mysql
Mac OSX
The socket file should be created automatically when the MySQL daemon starts.
If it isn't found, most likely the directory which is supposed to contain it doesn't exist, or some other file system problem is preventing the socket from being created.
To find out where the file should be, use:
% mysqld --verbose --help | grep ^socket