在SQL操作的时候报错如下
Mysql You can change this value on the server by setting the max_allowed_packet' variable.
Packet for query is too large (7012 > 2048). You can change this value on the server by setting the max_allowed_packet' variable.
解决方案
修改mySql的配置文件
1、查看现有的配置
mysql> show VARIABLES like '%max_allowed_packet%';
+--------------------------+-------+
| Variable_name | Value |
+--------------------------+-------+
| max_allowed_packet | 2048 |
| slave_max_allowed_packet | 2048 |
+--------------------------+-------+
2 rows in set (0.03 sec)
2、修改配置my.cnf
[root@VM_16_16_centos ~]# vi /etc/my.cnf
3、重启mysql
service mysqld restart
完!