I\'m getting this error
ERROR 2002 (HY000): Can\'t connect to local MySQL server through socket \'/var/run/mysqld/mysql.sock\' (2)
even though
I had the same problem after altering my.cnf. I resolved this problem next steps.
First : to find the location of error.log, look at 'my.conf'.
Second : I looked up error.log, I found next massages,
"unknown variable 'default-......' " ..... " mysqld_safe Starting mysqld darmon with from /var/lib/mysql "
Third : I reset my.conf to the default, then restart, this problem was resolved.
I hope this helps.