Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock'(2)

When you are working with MySQL server, you are getting the ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock‘ (2) on your terminal window, it means that mysqld socket is missing