Mysql Hibernate报错

错误信息:

2020-04-17 08:43:28,810 [http-nio-443-exec-8] ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] - 
Packet for query is too large (1673 > 1024). You can change this value on the server by setting the max_allowed_packet' variable.

当查询数据比较大的时候在网络中传输,超过默认值就会报以上错误

解决方法,找到mysql配置文件.my.ini,在[mysqld]下面添加以下配置

max_allowed_packet = 100M

query_cache_limit = 40M

修改好以后重启mysql服务

转载自:https://blog.csdn.net/xiaoping0915/article/details/64587042

原文地址:https://www.cnblogs.com/passedbylove/p/12727604.html