Error while sending QUERY packet
You guessed right MySQL have limitation for size of data, you need to break your query in small group of records or you can Change your max_allowed_packet by using SET GLOBAL max_allowed_packet=524288000;
You can solve this problem by following few steps:
1) open your terminal window
2) please write following command in your terminal
ssh root@yourIP port
3) Enter root password
4) Now edit your server my.cnf file using below command
nano /etc/my.cnf
if command is not recognized do this first or try vi then repeat: yum install nano.
OR
vi /etc/my.cnf
5) Add the line under the [MYSQLD] section. :
max_allowed_packet=524288000 (obviously adjust size for whatever you need)
wait_timeout = 100
6) Control + O (save) then ENTER (confirm) then Control + X (exit file)
7) Then restart your mysql server by following command
/etc/init.d/mysql stop
/etc/init.d/mysql start
8) You can verify by going into PHPMyAdmin or opening a SQL command window and executing:
SHOW VARIABLES LIKE 'max_allowed_packet'
This works for me. I hope it should work for you.
You may also have this error if the variable wait_timeout
is too low.
If so, you may set it higher like that:
SET GLOBAL wait_timeout=10;
This was the solution for the same error in my case.