Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock'”.

When I get the above error, it usually happens when mysql is not running.

You should start mysqld!