1、max_allowed_packet
Today, when synchronizing the db of a friend's company, an error is always reported. I thought it was a problem with the company's db, but later found that the ht_mtr_price_grid_info table has only 27 pieces of data, but the data volume reaches 16912KB
I looked at the table structure and found that the ht_mtr_price_grid_info.processList field is of type longtext.
Use the following sql to count the data volume of the ht_mtr_price_grid_info.processList field:
SELECT
length(PROCESSLIST),
length(PROCESSLIST) / 1024 AS kb,
length(PROCESSLIST) / 1024 / 1024 AS MB
FROM
ht_mtr_price_grid_info
Figure: The above sql execution result.
So I changed max_allowed_packet=100M, synced the data again, successful!
(My default max_allowed_packet=4M)
Reference: Mysql execute large file sql statement