I had the same issue. I found this.
ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’
This is because you are not running the mysqld daemon before launching the MySQL client. The file /var/lib/mysql/mysql.sock will be automatically created upon running the first instance of MySQL.
To fix:
First start the MySQL daemon, then type mysql:
/etc/init.d/mysqld start mysql
Changing MySQL Root Password
By default, the root password is empty for the MySQL database. It is a good idea to change the MySQL root password to a new one from a security point of view.
mysql> USE mysql; mysql> UPDATE user SET Password=PASSWORD('newpassword') WHERE user='root'; mysql> FLUSH PRIVILEGES;
Once done, check by logging in:
mysql -u root -p Enter Password: <your new password>