A way to check if your mysql database hangs, if so, restart it

MYSQL HANGCHECK
/usr/bin/mysql –host=127.0.0.1 –port=3306 –connect_timeout=30 –user=hang-check –password=’yourmysqlpassword’ -e ” || (/usr/bin/killall -9 mysqld_safe mysqld; /bin/sleep 15; /usr/sbin/service mysql start)