I am working on Magento site and I get this error:
SQLSTATE[HY000]: General error: 2006 MySQL server has gone away on running
cron job magento
DB Connections have a timeout which will cause this error if you try to send a query sometime after opening the connection. The usual scenario is:
So - what's the solution? You could simply increase the timeout, but that's ugly and could cause problems when traffic to your site increases. The best solution would be to close your DB connection and then re-open it like this:
Here's more information: http://dev.mysql.com/doc/refman/5.0/en/gone-away.html