MySql.sock file is mostly available in folder “/mysql/tmp/”. If you mistakenly deleted the MySql.sock file then this tutorial is very helpful for you.
1. Before making any changes first you have to take backup of /var/lib/mysql directory with this command :
# cp -fr /var/lib/mysql /var/lib/mysql.old
/var/lib/mysql and /tmp
# ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock
# chmod 0755 /var/lib/mysql # chown mysql:root /var/lib/mysql
cat /etc/passwd
# chmod -R 0660 /var/lib/mysql/mysql # chown -R mysql:mysql /var/lib/mysql/mysql # /usr/bin/mysql_install_db
# /scripts/mysqlup –force
# rm -fr /var/lib/mysql # rm -f /usr/sbin/mysqld
# /scripts/mysqlup –force
These all steps will definitely help you to overcome this problem.