0

I'm trying to import a Wordpress Plugin database that stores files in the table using the longblob datatype. The database is on one server, so I exported it to import on another server, but have received various errors, the latest of which is "Got a packet bigger than 'max_allowed_packet' bytes".

Previously, these commands were run on the server: set global max_allowed_packet=10000000; and set global net_buffer_length=1000000; The server has been restarted since then.

Any ideas as to what would cause this? I'm fairly new to all of this, so I may not be providing all of the necessary information. Let me know if I need to clarify.

Thanks in advance for your time!

JamieHoward
  • 693
  • 2
  • 11
  • 27
  • 1
    If the packer you're sending is larger than 9.5 megabytes, then you'll always exceed the limit. Increase the limit to 128 MB and try again. After that you can reset it to lower value. – N.B. Feb 13 '13 at 15:03
  • @N.B. Thanks for the quick response! I must be a noob, haha. I did the following: SHOW VARIABLES. Saw that max_allowed_packet = 1048576. Then, "SET GLOBAL max_allowed_packet=134217728;" After restarting the server, I still see max_allowed_packet is set to 1048576. – JamieHoward Feb 13 '13 at 15:13
  • http://stackoverflow.com/questions/3754238/is-there-any-way-to-insert-a-large-value-in-a-mysql-db-without-changing-max-allo – akostadinov Apr 13 '15 at 09:05

1 Answers1

3

Set the variable in your my.cnf file. On linux you can find this at /etc/my.cnf and add the following line:

max_allowed_packet = 64M

Don't forget to restart mysql after you've made this change.

Joe Meyer
  • 4,315
  • 20
  • 28