MySQL: “Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (38)” To fix it, try the following: 1. In the terminal, run ‘touch /tmp/mysql.sock’. 2. Restart mysql.