I have spent the best part of today tearing my hair out, trying to figure out why the mysql.sock socket file was missing from my clean ZendServer CE install. From googling a little on the subject it seems I am not the only one to suffer this fate. Turns out that none of the solutions suggested in these articles applied for me.
A few weeks back, when I got my brand new MacBook Pro I decided to play around with ZendServer, and ended up changing things so much that I decided to just do a clean install. So I followed Zend’s method of uninstalling the server and proceeded to install my new, fresh copy. I was a little surprised when I was receiving errors from my mysql instance…
ERROR 2002: Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (2)
I did a little digging around my Mac, I tried running a find..
sudo find / -name mysql.sock
But this returned nothing. The mysql.sock file is apparently located at
/usr/local/zend/mysql/tmp/mysql.sock or alternatively
/tmp/mysql.sock, but mine had vanished from the file system completely. After a little digging, I found a shell script bundled in with ZendServer,
/usr/local/zend/bin/uninstall.sh. Running this script cleaned out my current installation and after performing another clean install of ZendServer I had my mysql.sock file back where it should have been.
It’s pretty strange as to why Zend haven’t updated their instructions for removing ZendServer correctly, and it can potentially cause a lot of issues if you’re hoping to use mysql in the future.