Search code examples
phpmysqlmysql-error-2006

MySQL Error 2006: MySQL Server has gone away while executing cron job


I knew this error occurs when server restart or bandwidth issue. But we have unlimited bandwidth and server is not going restart. I'm unable to trace why I'm getting this error.

This error occurs only when i run cron job on the server. I've set cron job for every 10 min to perform few calculations and update tables.

protocol_version : 10
version : 5.1.65-cll
version_comment : MySQL Community Server (GPL)
version_compile_machine : x86_64
version_compile_os : unknown-linux-gnu

Please help.


Solution

  • Actual issue was with my count of queries executing. About 50000 queries were executing for every 10 min so server was going away. I've reduced the limit and time interval, it is working fine now.

    Thanks for your answers, it also helped me a lot.