until last week magento cron was working fine. Suddenly it started giving following error. I have checked my local.xml and database username, password and all these things are there. My site is working fine. The error only happen in cron. Cron is working fine.. I am getting email from cron with the following error. When i run cron.php in browser two times it starts and executes jobs. Please help how to resolve this issue to run cron properly.
X-Powered-By: PHP/5.2.17 Content-type: text/html
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)' in /home/home/public_html/mydir/lib/Zend/Db/Adapter/Pdo/Abstract.php:129
Stack trace:
#0 /home/home/public_html/mydir/lib/Zend/Db/Adapter/Pdo/Abstract.php(129): PDO->__construct('mysql:host=loca...', 'database name', 'database password', Array)
#1 /home/home/public_html/mydir/lib/Zend/Db/Adapter/Pdo/Mysql.php(96): Zend_Db_Adapter_Pdo_Abstract->_connect()
#2 /home/home/public_html/mydir/lib/Varien/Db/Adapter/Pdo/Mysql.php(313): Zend_Db_Adapter_Pdo_Mysql->_connect()
#3 /home/home/public_html/mydir/lib/Zend/Db/Adapter/Abstract.php(459): Varien_Db_Adapter_Pdo_Mysql->_connect()
#4 /home/home/public_html/mydir/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SET NAMES utf8', Array)
#5 /home/home/public_html/mydir/lib/Varien/Db/Adapter/Pdo/Mysql.php(419): Zend_Db_Adapter_Pdo_Abstra in <b>/home/home/public_html/mydir/lib/Zend/Db/Adapter/Pdo/Abstract.php</b> on line <b>144</b><br />
I really need to run my cron job. Thanks in advance