查询mysql数据库时报错
Packet for query is too large (1281 > 1024). You can change this value on the server by setting the max_allowed_packet'
1. 找到mysql的配置文件
linux下通常位于为/etc/mysql/my.cnf, 在[mysqld]下添加
max_allowed_packet = 16M
2. 重启mysql
service mysql restart
3. 检查
- 登录mysql
- 执行
show VARIABLES like '%max_allowed_packet%'
运行结果如图所示,问题解决