mysql5中大数据错误:Packet for query is too large (1117260 > 1048576). You can change this value on the ser
来源:互联网 发布:php截取某个字符串 编辑:程序博客网 时间:2024/05/16 08:53
mysql5数据,插入或更新字段有大数据时(大于1M),会出现如下错误:
有时候命令“SET GLOBAL max_allowed_packet=16*1024*1024”无效,需要使用如下命令:set @@max_allowed_packet=5*1024*1024
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 value on the server by setting the max_allowed_packet' variable.] with root cause java.sql.BatchUpdateException: Packet for query is too large (1117260 > 1048576). You can change this value on the server by setting the max_allowed_packet' variable.
开始以为是相应字段的类型设置不正确,超出了字段的最大范围,网上查询后发现是mysql默认加载的数据文件不超过1M,可以通过更改mysql的配置文件my.cnf(Linux,或windows的my.ini)来更改这一默认值,从而达到插入大数据的目的。
解决:
MySQL的一个系统参数:max_allowed_packet,其默认值为1048576(1M),
可以先查询一下:show VARIABLES like '%max_allowed_packet%';
修改此变量的值:MySQL安装目录下的my.ini文件中的[mysqld]段中的"max_allowed_packet = 1M",如更改为4M(如果没有这行内容,增加一行),保存,重新启动MySQL服务。现在可以load大于1M的文件了。
0 0
- mysql5中大数据错误:Packet for query is too large (***>***). You can change this value on the ser
- mysql5中大数据错误:Packet for query is too large (1117260 > 1048576). You can change this value on the ser
- Packet for query is too large (1986748 > 1048576). You can change this value on the server by
- packet for query is too large <1781> 1024 >. you can change this value on the server by setting the
- Packet for query is too large (1029 > 1024). You can change this value on the server by setting the
- Packet for query is too large (1032 > 1024). You can change this value on the server by setting the
- mysql Packet for query is too large (5058927 > 4194304). You can change this value on the server by
- Packet for query is too large (12238 > 1024). You can change this value
- Tomcat 报错:Packet for query is too large (12238 > 1024). You can change this value
- 【问题解决】Packet for query is too large (1165 > 1024). You can change this value
- Packet for query is too large (12238 > 1024). You can change this value
- com.mysql.jdbc.PacketTooBigException: Packet for query is too large (4200044 > 1048576). You can cha
- com.mysql.jdbc.PacketTooBigException: Packet for query is too large (11707239 > 1048576). You can c
- MySQL中Packet for query is too large (1327736 > 1048576)错误
- Packet for query is too large(Packet>1048576)
- mysql5.5异常: java.sql.SQLException: Packet for query is too large (1055975 > 1048576).
- mysql5.5异常: java.sql.SQLException: Packet for query is too large (1055975 > 1048576).
- mysql5.5异常: java.sql.SQLException: Packet for query is too large (1055975 > 1048576).
- Centos中无法使用make,make install,命令 make: command not found
- 判断字符串回环变位
- 博客访问量1000人次
- HDU 1575 Tr A (矩阵快速幂)
- OkHttp学习之 一些可以避开的坑
- mysql5中大数据错误:Packet for query is too large (1117260 > 1048576). You can change this value on the ser
- 关于某个模块context的获取
- JZ2440:时钟设置
- github上的安卓开源库汇总
- 将UIDatePicker的日期显示为数字和中文
- Elementary0.3.2/Ubuntu14.04安装GooglePinYin输入法
- iOS计算时间,刚刚,几分钟前,几小时前
- linux远程命令行安装matlab
- Android音视频录制类MediaRecorder用法举例