- 查看最大执行sql长度大小:
show VARIABLES like '%max_allowed_packet%';
- 不用重启mysql,马上有效设置
SET GLOBAL max_allowed_packet=20971520;
- 修改最大执行sql变量:
vi /etc/my.cnf
//在[mysqld]下添加
max_allowed_packet = 20M
show VARIABLES like '%max_allowed_packet%';
SET GLOBAL max_allowed_packet=20971520;
vi /etc/my.cnf
//在[mysqld]下添加
max_allowed_packet = 20M
转载于:https://my.oschina.net/colin86/blog/776189