First start the mysql server:
service mysqld start
To check if it is running, run this command:
mysqladmin -u root -p status
Check if you can connect now. If the error still exists, then try to change the permission of mysql directory
sudo chmod -R 777 /var/lib/mysql/