解决Mysql You can change this value on the server by setting the max_allowed_packet' variable. 异常
2017-11-13 17:30
681 查看
场景:
项目需要导入excel数据,2200行。报错信息:
Mysql You can change this value on the server by setting the max_allowed_packet' variable.Packet for query is too large (6832997 > 4194304). You can change this value on the server by setting the max_allowed_packet' variable.
解释:
用于查询的数据包太大(6832997> 4194304)。 您可以通过设置max_allowed_packet的变量来更改服务器上的这个值。通过解释可以看到用于操作的包太大。这里要插入的excel表大小为1.3M 所以报错。
解决方法:
服务上的数据库是mysql。然后查了一下资料是MySQL的一个系统参数问题:max_allowed_packet,其默认值为1048576(1M),
查询:show VARIABLES like '%max_allowed_packet%';
修改此变量的值:MySQL安装目录下的my.ini文件中的[mysqld]段中的
"max_allowed_packet = 1M",如更改为4M(或更大,如果没有这行内容,增加一行),
保存,重起MySQL服务。现在可以load大于1M的文件了。
相关文章推荐
- Mysql You can change this value on the server by setting the max_allowed_packet' variable. 异常
- 服务器的日志一直报Packet for query is too large (7632997 > 4194304). You can change this value on the server by setting the max_allowed_packet' variable.的解决方法
- Linux服务器上日志报com.mysql.jdbc.PacketTooBigException: Packet for query is too large (1783 > 1024). You can change this value on the server by setting the max_allowed_packet' variable.
- 查询的时候Tomcat打印You can change this value on the server by setting the max_allowed_packet' variable解决方法
- You can change this value on the server by setting the 'max_allowed_packet' variable.
- MySQL5中大数据错误:Packet for query is too large (****** > ******). You can change this value on the server by setting the max_allowed_packet' variable.;
- Packet for query is too large (1986748 > 1048576). You can change this value on the server by setting the max_allowed_pa
- Packet for query is too large (1032 > 1024). You can change this value on the server by setting the
- 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
- mysql Packet for query is too large (5058927 > 4194304). You can change this value on the server by
- Packet for query is too large (1986748 > 1048576). You can change this value on the server by
- Packet for query is too large (2044 > 1024). You can change this value on the server.........
- 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
- mysql5中大数据错误:Packet for query is too large (***>***). You can change this value on the ser
- 【问题解决】Packet for query is too large (1165 > 1024). You can change this value
- Tomcat 报错:Packet for query is too large (12238 > 1024). You can change this value
- How to change max_allowed_packet value in mysql?
- How to change max_allowed_packet value in mysql?