在登录的时候需要取出用户信息,这个sql有点长,导致报了以下的错
### Cause: com.mysql.jdbc.PacketTooBigException: Packet for query is too large (1742 > 1024). You can change this value on the server by setting the max_allowed_packet' variable.
; SQL []; Packet for query is too large (1742 > 1024). You can change this value on the server by setting the max_allowed_packet' variable.; nested exception is com.mysql.jdbc.PacketTooBigException:Packet for query is too large (1742 > 1024). You can change this value on the server by setting the max_allowed_packet' variable.
经过初步判断:
应该是max_allowed_packet这个值太小导致
解决办法
1.查看当前值: SHOW VARIABLES LIKE '%max_allowed_packet%';
2.修改/usr/local/mysql/etc/my.cnf中的max_allowed_packet = 512M;
3.重启Mysql服务systemctl restart mysqld.service
出现的问题:上一次就是这么操作 解决了的,但是这次又出现了这个问题.网上搜了一下原因,有的人看数据库操作日志 发现是有人改成了1024,也就是说 被攻击了. 下次我也看看...