First thing in the morning, I got this mysql server error.

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

Apparently, /tmp/mysql.sock is missing. I know that’s the right path, but the file is not there.

I restarted the mysql server by press the “Start MySQL Server” button, but it’s not running. I ran mysqld, but it gave me more errors and failed to start.

I ended up making it work by providing a my.cnf file, which I hadn’t needed.

sudo cp /usr/local/mysql/support-files/my-large.cnf /etc/my.cnf

Modify the default settings if needed. Then press the “Start MySQL Server” button again. My apache server then worked fine.