Michael Gray

Wordpress MySQL Error - Got a packet bigger than ‘max_allowed_packet’ bytes

Posted on February 18th, 2007
by 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

WordPress database error: [Got a packet bigger than 'max_allowed_packet' bytes]

Sphere: Related Content

Text Link Ads


9 Responses to “Wordpress MySQL Error - Got a packet bigger than ‘max_allowed_packet’ bytes”

  1. User GravatarLea Says:

    Try doing a repair on the table - its under ‘Operations’ for the table if you use PHPMyAdmin

  2. User GravatarZack Says:

    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?

  3. User GravatarDuncan Says:

    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 :-)

  4. User Gravatartony rocks Says:

    Mike,
    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 :) hehe.

    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.

  5. User Gravataryuga Says:

    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

  6. User GravatarCal Says:

    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.

  7. User GravatarMaurice Says:

    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.

  8. User GravatarZack Says:

    Maurice: don’t blame MySQL for that, there are bad coders using every DB. :)

  9. User GravatarDoug Karr Says:

    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.