Not sure what I did, but I'd love some advice to make this one go away - thanks!
user warning: Got a packet bigger than 'max_allowed_packet' bytes query: UPDATE cache_menu SET data = 'a:932:{s:4:\"node\";a:26:{s:5:\"title\";s:7:\"Content\";s:13:\"page callback\";s:17:\"node_page_default\";s:16:\"access arguments\";a:1:{i:0;s:14:\"access content\";}s:4:\"type\";i:4;s:6:\"module\";s:4:\"node\";s:14:\"load_functions\";s:0:\"\";s:16:\"to_arg_functions\";s:0:\"\";s:6:\"weight\";i:0;s:13:\"_number_parts\";i:1;s:6:\"_parts\";a:1:{i:0;s:4:\"node\";}s:4:\"_fit\";i:1;s:8:\"_visible\";b:1;s:4:\"_tab\";b:0;s:10:\"tab_parent\";s:0:\"\";s:8:\"tab_root\";s:4:\"node\";s:15:\"access callback\";s:11:\"user_access\";s:14:\"page arguments\";a:0:{}s:14:\"block callback\";s:0:\"\";s:15:\"title arguments\" in /usr/home/hoslo/public_html/includes/cache.inc on line 109.
Comments
searching with some portion
searching with some portion of the error message often yields useful results. See:
===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz
See #317775: Cacheing entire
See #317775: Caching entire {menu_router} table causes MySQL error/slow rebuilds and slows menu_link_save.
gpk
----
www.alexoria.co.uk
gpk
----
www.alexoria.co.uk
I had this problem whenever
I had this problem whenever I enabled views.
Turned out that max_allowed_packet was set 1M in MySQL. Increasing this to 8MB sorted the problem.
James T
Action Medical Research - www.action.org.uk
James T
Action Medical Research - www.action.org.uk
Changing the MySQL Value
Not nowing much about the workings of MySQL, found that if I ran the following query (via phpMyAdmin) then I could change the value (note syntax of bytes value):
SET GLOBAL max_allowed_packet=16*1024*1024;If doing this via shell, use (again note format of bytes value):
mysql --max_allowed_packet=16MThere's probably a more permanent way of doing this, but beyond my skillset, alas. Either way, it prevented the MySQL error occuring.
A useful tip :)
A useful tip :)
Unfortunatly you need the SUPER privilege to do that, so won't help many on shared hosts.
Also one can check the current value with
SHOW VARIABLES LIKE 'max_allowed_packet'. Happily my host has set it to about 32M :Dgpk
----
www.alexoria.co.uk
gpk
----
www.alexoria.co.uk
How do I make the warning go
How do I make the warning go away? I don't mean fixing the problem, I just mean go away!
:)
if you go to Administer ->
if you go to Administer -> Site configuratoin -> Error reporting you can stop warnings and errors from displaying on the screen. They will still be logged though.
gpk
----
www.alexoria.co.uk
gpk
----
www.alexoria.co.uk
Thanks very much!
Turned out the core problem for me was that a database table had gotten lost. Fixed that and the error went away.
:)
What table? How did you fix
What table? How did you fix that?
Im having the same problem
thanks
In my case, the problem was
In my case, the problem was that the cache_view table was missing after a site migration. The clue to the problem was found in the error message which, albeit in messed-up code, included something like "table not found" or something.
I think that it'd be smart before a migration to truncate all the cache tables. Lots of non-needed data that makes the system cranky.
:)
so how did you fix the cache
so how did you fix the cache view table. Just curious. I know this is an old post too.
Online Batman fan site and Community http://www.batmantrailer.net
One way would be to copy an
One way would be to copy an empty table of the same name from another site. Or copy, then empty, if you prefer.
gpk
----
www.alexoria.co.uk
This is not accurate. Since
This is not accurate. Since this is a PHP error, you need to disable error reporting in php.ini -- disabling it in Drupal is not sufficient.
Update...
A couple of other workarounds:
1. Use a different caching module/mechanism (e.g. one that uses files)
2. Run the query
SET SESSION max_allowed_packet=16*1024*1024;on each pageview (e.g. in hook_init()).gpk
----
www.alexoria.co.uk
gpk
----
www.alexoria.co.uk
Where do you mean in hook_init()?
I don't understand. hook_init()? init() is a hook in each module. Are we supposed to put a db_query('SET SESSION max_allowed_packet=16*1024*1024;') in every module?! Isn't there anywhere the MySQL session variables are set on session initialization? This is crazy. Why do the packets get so large? Shouldn't the data be packetized into smaller chunks?
I've tried putting the query in db_connect(), doesn't fix it. _db_query(), no luck. I don't get it. Can't believe someone hasn't squashed this bug before.
Still FREAKIN'!! #^&^%$%^&^ :-)
>Where do you mean in
>Where do you mean in hook_init()?
In a tiny custom module.
e.g. put query in function fix_mysql_packet_size_init() in fix_mysql_packet_size.module. Would also need a .info file.
gpk
----
www.alexoria.co.uk
gpk
----
www.alexoria.co.uk
Created a handbook page
It explains how to make such a module.
- Arie
And here it is:
http://drupal.org/node/379976
gpk
----
www.alexoria.co.uk
Thanks
Totally forgot to post the link LOL
- Arie
:P
:P
gpk
----
www.alexoria.co.uk
Configuring MySQL on stock Leopard Installation
A little off topic, but relevant to my original post...
How do you tweak MySQL parameters on the standard (pre-installed) Leopard installation of MySQL? I cannot seem to find the right my.cnf file anywhere? Any clues? Or should I be looking in php.ini??
Getting fed up running this query on my MPB after every reboot.
I don't know about you, but I
I don't know about you, but I found that tweaking the Leopard settings made things far too complicated - just use MAMP (free download from mamp.info). Makes things much simpler.
Leopard Config
Note that on the Leopard Server admin, the config files are located off root at etc/my.cnf and etc/php.ini ... they are hidden by default, so unless you are using CLI you have to adjust you visibility settings like so:
http://www.macworld.com/article/51830/2006/07/showallfinder.html
Not sure if all this is the same on OSX, but I believe that it is.
my.cnf on Leopard
My 10.5 Mac did not have an /etc/my.cnf file, but I created one and added this:
[mysqld]
max_allowed_packet=50M
and then restarted the mysql server:
sudo /Library/StartupItems/MySQLCOM/MySQLCOM restart
That seems to have fixed the problem.
This totally worked for me!
This totally worked for me!
here is a simple fix you can do by commenting out 1 line
If you go to the file; database.mysqli.inc in the folder /includes
and search for this line;
trigger_error(check_plain(mysqli_error($active_db) ."\nquery: ". $query), E_USER_WARNING);
it occurs at about line 134
and simply comment it out, by changing it to this
// trigger_error(check_plain(mysqli_error($active_db) ."\nquery: ". $query), E_USER_WARNING);
you will solve the problem.
Cheers! Ricco
Hmmm I suspect that might
Hmmm I suspect that might suppress all database errors, which might or might not be what most people want/need.. ;)
gpk
----
www.alexoria.co.uk
CORRECT!
It was solve the problem!
Worked! :D Cheers!
Cheers m8! you saved me lots of work :D
Thanks!
Steps for changing max_allowed_packet in MAMP PRO
If you are using MAMP PRO, you have to access the my.cnf file through the MAMP application menu:
MAMP PRO > File > Edit template > MySQL my.cnf
Screenshot of MAMP PRO MySQL my.cnf
Then Stop / Start MAMP.
: z
Very Useful! - worked for me
This worked for me .. thanks for sharing
Sumit Kataria
http://sumitk.net
http://twitter.com/sumitk
Thanks!
This solution solved my problem on an installation of Open Publish
disable cache menu
See: http://drupal.org/node/321154#comment-1059946
The following will increase the limit
The following will increase the limit:
VM's comment is also very worth looking over for a broader understanding of what's going on.
and of course grab a copy of The Definitive Guide to Drupal 7 for more tips on setting up your development environment, among other topics.
ownsourcing.com - Drupal training
repair table
repairing the cache_menu table in phpMyAdmin worked for me.