Cron crashes MySQL

As others have said it's likely triggered by a long running script. Any script that takes a long time to run without using the database can potentially timeout.

I've had this happen before. We have a script that connects to a remote server, downloads a few hundred xml files, parses and converts them into a .csv file for import via the built in Magento ImportExport module. We have a custom logging module, which allows us to track what happened with our routines. The very first thing the class does, is add a row to this log table to say routine started. It then takes 5-10 minutes to fetch the remote xml files. After downloading the files it attempts to write another log entry to say that it's finished. Since the mysql connection has been open since the first log event and hasn't been used since, mysql has closed the connection as it has received no query for longer than the timeout period.


In your /etc/mysql/my.cnf try increasing the value for max_allowed_packet

Eg.

max_allowed_packet = 256M

Then restart MySQL.

Tags:

Database

Error