ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

Hello,
I need to access the database via ssh but this error appears when typing the command “mysql”: ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)

How could I solve this and access the database ?
I’ve been looking for a solution for days and I can’t find anything to solve it …: /

Thankful.