This sounds like an issue with max_allowed_packet
size in your my.cnf
. More details here.
The details below mention using the mysqld
from the command line to adjust this. But if possible it is best to just go straight into the my.cnf
file and adjust max_allowed_packet
in there. For example on a few servers I manage that use InnoDB, I set that value to max_allowed_packet=64M
.
The server's default max_allowed_packet value is 1MB. You can increase
this if the server needs to handle big queries (for example, if you
are working with big BLOB columns). For example, to set the variable
to 16MB, start the server like this:
shell> mysqld --max_allowed_packet=16M
You can also use an option file to set max_allowed_packet
. For
example, to set the size for the server to 16MB, add the following
lines in an option file:
[mysqld]
max_allowed_packet=16M
It is safe to increase the value of this variable because the extra
memory is allocated only when needed. For example, mysqld allocates
more memory only when you issue a long query or when mysqld must
return a large result row. The small default value of the variable is
a precaution to catch incorrect packets between the client and server
and also to ensure that you do not run out of memory by using large
packets accidentally.
EDIT: I also found another setting that might help, net_buffer_length
:
Each client thread is associated with a connection buffer and result
buffer. Both begin with a size given by net_buffer_length
but are
dynamically enlarged up to max_allowed_packet
bytes as needed. The
result buffer shrinks to net_buffer_length
after each SQL statement.
This variable should not normally be changed, but if you have very
little memory, you can set it to the expected length of statements
sent by clients. If statements exceed this length, the connection
buffer is automatically enlarged. The maximum value to which
net_buffer_length
can be set is 1MB.
The default for net_buffer_length
is 16384 bytes which is 0.015625MB which then is 16KB. Try adjusting that value & try again. Maybe something like 524288 bytes which is 512 KB or 131072 bytes which is 128 KB. What you need to know is net_buffer_length
is connected directly to mysqldump
line lengths. So this could be it.