Create the directory if it is not there:
Code:
sudo mkdir /var/run/mysqld/
touch the file to create it
Code:
sudo touch /var/run/mysqld/mysqld.sock
change the ownership of the folder and socket to the mysql user
Code:
sudo chown mysql /var/run/mysqld/
sudo chown mysql /var/run/mysqld/mysqld.sock