Wordpress MySQL Error - Got a packet bigger than ‘max_allowed_packet’ bytes
Posted on February 18th, 2007by Michael Gray in Random Thoughts
If you're new here, you may want to subscribe to my RSS feed. Read my top posts or learn more about Michael Gray. Want more frequent updates follow me on Twitter. Thanks for visiting!
I’m sure someone who reads this blog has some MySql Fu and can tell me in non-programming speak how to fix this error with one of my plugins
Sphere: Related ContentWordPress database error: [Got a packet bigger than 'max_allowed_packet' bytes]











February 18th, 2007 at 10:42 pm
Try doing a repair on the table - its under ‘Operations’ for the table if you use PHPMyAdmin
February 18th, 2007 at 10:48 pm
Basically it means that you’ve sent a query (or received a response) that’s too large for your server’s config. You can change it, but if your version of MySQL is higher than 4.0 (which is REALLY old) then it’s already 1GB, so odds are, your query’s going to cause problems if you let it run. What plugin is this?
February 19th, 2007 at 12:18 am
Sounds like a setting somewhere in the WP code, have you tried the support forums at Wordpress.org yet? usually somewhere out there someone will have had the same issue, law of averages and numbers
February 19th, 2007 at 1:13 am
Mike,
hehe.
I think people are just posting comments just to get some links to their own websites. I don’t see any answers here my friend
Which plugin is giving you grief? I’m guessing it is some kind of query building plugin…for search or something. Possibly dynamically built with wildcards or large strings of items in the WHERE clause.
February 19th, 2007 at 2:28 am
You can increase your value for that by editing your /etc/my.cnf (mySQL config file) in your server.
I just checked mine and it states:
max_allowed_packet=16M
February 19th, 2007 at 4:15 am
Yuga is right. It is a setting in your my.cnf
It defines the maximum size of your blob/text type in your mysql tables.
February 19th, 2007 at 1:32 pm
yeh we have that on some of our bigger blogs it was a plugin that tries to generate sitemaps and because the way the guy coded it it breaks - my sql is such a profesional database NOT!
basicly its mungeing a lot of row insert/updates into one huge mega sql statement that throws the error.
February 19th, 2007 at 3:03 pm
Maurice: don’t blame MySQL for that, there are bad coders using every DB.
February 19th, 2007 at 10:01 pm
Zacks correct, Maurice. It’s simply a setting and an issue of how it was developed - not a MySQL issue.
There are additional settings like this as well… when my site was hit after making the home page of Netscape, I hit a max query threshold (21,000 per hour I believe).
I found out it was a setting configured by my hosting provider. Luckily I upgraded the package so I could modify it. The setting was simply to protect the servers from too much query traffic.