OK, at this point, we have established that mysql is running, but the client cannot connect to it.
Few things to check.
Does /tmp/mysql.sock exist?
To find out run:
ls -1lah /tmp/mysql.sock
If you see an error message, then for some reason, the file was removed.
service mysql restart
try connecting again.
If you still get the same error message, then we need to verify that the socket file location specified in your /etc/my.cnf (depending on your configuration, that file may also exist at /etc/mysql/my.cnf) is the same for both the service and the client.
Check [mysqld] section.
You should find
socket = /tmp/mysqld.sock
Check the [client] section, make sure the same exists.
If not, change according.
The general rule is the client section to match what the [mysqld] section has for the socket file location, so if it is
/tmp/mysqld.sock, then client section should have /tmp/mysqld.sock
If it is something else, like /var/run/mysqld/mysqld.sock then client should have the same.
Ctrl + o and then Enter to save.
Ctrl + x to exist nano.
If you have made any changes, restart mysql, and try again.