mysql> set global max_allowed_packet=1024*1024*16;
Query OK, 0 rows affected
mysql> show global variables like 'max_allowed_packet';
+--------------------+----------+
| Variable_name | Value |
+--------------------+----------+
| max_allowed_packet | 16777216 |
+--------------------+----------+
1 row in set
mysql>
参考链接:https://blog.csdn.net/boshuzhang/article/details/73603772