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
I got the exact path using:
netstat -ln | grep -o -m 1 -E '\S*mysqld?\.sock'
Since this only returns the path and doesn't require any input you could potentially use it in a shell script.
MySQL must be currently running on your machine for this to work. Works for MariaDB too.