ERROR 2002 (HY000): Can't connect to local MySQL server through socket
'/var/lib/mysql/mysql.sock' (2)
In such cases follow these steps to reconfigure mysql:
- Delete the log files with the names: ib_logfile0, ib_logfile1 and ibdata1 in the /var/lib/mysql directory
- Then type: "mysqld_safe --user=mysql &"
This will automatically create mysql.sock file and even the new logs files.