欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

Even after +500mb set in max_allowed_packet… it still gives me an error

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!

Rosamunda

shareimprove this questionasked Dec 25 '12 at 3:31Rosamunda9,08252444

1 Answer 正确答案

Few things to consider:

  1. Are you sure that the syntax of max_allowed_packet is correct? Are you specifying the units? i.e. max_allowed_packet = 512M

  2. Are you sure MySQL is using the same my.cnf file you are editing? Login to MySQL from console, and run: SHOW GLOBAL VARIABLES; Is max_allowed_packet set correctly?

  3. Finally, if all fails, consider this workaround via Drupal Tweaks module: http://drupal.org/project/drupal_tweaks

shareimprove this answeranswered Dec 25 '12 at 3:38djdy5,13742857

   Thanks for your reply!! The guys at my hosting have change the values, so I´ve assumed they were using the correct syntaxis. Maybe I should go and verify that by myself... – Rosamunda Dec 25 '12 at 3:40   I´ve checked with the root user, at phpmyadmin, and this is the configuration: Variable Session value / Global value max allowed packet 1,048,576 slave max allowed packet 1,073,741,824 – Rosamunda Dec 25 '12 at 3:55   I´ve checked using the console and it says the same: +--------------------+---------+ | Variable_name | Value | +--------------------+---------+ | max_allowed_packet | 1048576 | +--------------------+---------+ 1 row in set (0.00 sec) – Rosamunda Dec 25 '12 at 4:38   Oops! It lost formatting: max_allowed_packet | 1048576 – Rosamunda Dec 25 '12 at 4:38   Perhaps the value may need to be even higher than that. For the sake of a test, are you able to push it up even higher? Of course, don't leave it super high in production. – djdy Dec 25 '12 at 5:17 

Your Answer

来自 https://stackoverflow.com/questions/14027455/even-after-500mb-set-in-max-allowed-packet-it-still-giv...

普通分类: