RROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2
1. Cause a process
ps -A | grep -i mysql
kill list to the process (close sql process all closed)
Then start
service mysql start
The perfect solution!
2. cause two
The reason is that the service does not start mysql
service mysql start