mysql5数据,插入或更新字段有大数据时(大于1M),会出现如下错误:
SEVERE: Servlet.service() for servlet [webs] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.dao.TransientDataAccessResourceException: Hibernate flushing: Could not execute JDBC batch update; SQL [update t_article set (省略部分...)author_id=? where id=?]; Packet for query is too large (1117260 > 1048576). You can change this value on the server by setting the max_allowed_packet' variable.; nested exception is java.sql.BatchUpdateException: Packet for query is too large (1117260 > 1048576). You can change this v
在mysql5中遇到插入或更新大数据时出现错误:Packet for query is too large。该问题由mysql默认加载数据文件不超过1M引起。解决方案是通过修改my.cnf配置文件,增大`max_allowed_packet`的值,或者在命令行临时设置该变量,以允许插入或更新大数据。
订阅专栏 解锁全文

638

被折叠的 条评论
为什么被折叠?



