Most Common Cause
There are various things that can cause this issue- obviously since we have so many different solutions being presented. I troubleshoot sites for a living and this is what I find to be the most common reason for this error.
When sql runs it creates temp files, one of these is the sock file mentioned within this error. Within your my.cnf file it is specified where sql attempts to find/write this file.
First check your system to see where my.cnf is, if you can't find it- its because sql is not running and hasn't ran in the past. Check the path specific in your my.cnf, then check the owners on that directory. Usually this happens because the owners permissions are not quite right. Such as a mysql:root ownership.
To fix it, simply run a chown mysql:mysql directoryname. Restart sql, service restart mysql, /etc/init.d/mysql restart, /etc/init.d/mysqld restart - usually one of those variations on linux.
Hopefully this helps save some time. As I said there are numerous reasons, I find this is the most common. Especially if you've moved the install to another server.
|