I´ve just moved my Drupal site to a new managed VPS.
Each time I try to run cron, I get this nasty error:
Warning: Got a packet bigger than 'max_allowed_packet' bytes query: INSERT INTO watchdog (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (1, 'php', '%message in %file on line %line.', 'a:4:{s:6:\"%error\";s:12:\"user warning\";s:8:\"%message\";s:1582172:\"Got a packet bigger than 'max_allowed_packet' bytes\nquery: UPDATE cache_update SET data = 'a:72:{s:10:\"admin_menu\";a:10:{s:5:\"title\";s:19:\"Administration menu\";s:10:\"short_name\";s:10:\"admin_menu\";s:10:\"dc:creator\";s:3:\"sun\";s:11:\"api_version\";s:3:\"6.x\";s:17:\"recommended_major\";s:1:\"1\";s:16:\"supported_majors\";s:3:\"1,3\";s:13:\&qu in /home/drupal/includes/database.mysql.inc on line 135
The thing is that I´ve set max_allowed_packet to 64, then 100, then 250 and then 512!!! And still gives me that error.That error seems to be related to the admin_menu module, but even after disabling that module, the error is still there (referencing other module) and after disabling that other module, the error is still there, and so on an on.
It seems that the problem is related to the mySQL table "cache_update" but I can´t understand what´s going on. Even after searching Drupal forums, I couldn´t manage to get to the problem. Just found some ways hacking core, wich isn´t good.
I think this is a mysql specific issue, so that´s why I´m posting this here.
Thanks for your insight!
正确答案Few things to consider:
Are you sure that the syntax of
max_allowed_packet
is correct? Are you specifying the units? i.e.max_allowed_packet = 512M
Are you sure MySQL is using the same
my.cnf
file you are editing? Login to MySQL from console, and run:SHOW GLOBAL VARIABLES;
Ismax_allowed_packet
set correctly?Finally, if all fails, consider this workaround via Drupal Tweaks module:http://drupal.org/project/drupal_tweaks