I am getting the following error when I try to connect to mysql:
Can\'t connect to local MySQL server through socket \'/var/lib/mysql/mysql.sock\' (2)<
Can\'t connect to local MySQL server through socket \'/var/lib/mysql/mysql.sock\' (2)
It worked for me with the following changes
Whatever path for socket is mentioned in [mysqld] and same in [client] in my.cnf and restart mysql
[mysqld] socket=/var/lib/mysql/mysql.sock
[client] socket=/var/lib/mysql/mysql.sock