MySQL and CocoaMySQL /tmp/mysql.sock

I was having problems making a connection to a MySQL 5 database from CocoaMySQL, both running on Mac OS X Server 10.5. I fired up Terminal, punched in the following line of code:

sudo ln -s /var/mysql/mysql.sock /tmp/mysql.sock

and all was good.

** UPDATE 1/6/2017 **

Was having a similar problem under MacOS High Sierra Server.

Error 2002 [HY000]: Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ [2]

I opened Terminal and punched in the following lines of code:

mkdir /var/lib/mysql/
sudo ln -s /var/mysql/mysql.sock /var/lib/mysql/mysql.sock

All is good (again).

Leave a Reply

Your email address will not be published. Required fields are marked *