mysql报错

来源:互联网 发布:知乎 奥斯卡成龙 编辑:程序博客网 时间:2024/05/29 14:25

mysql插入数据报错:
问题一:

Error: java.io.IOException: com.mysql.jdbc.PacketTooBigException: Packet for query is too large (6519579 > 4194304). You can change this value on the server by setting the max_allowed_packet' 

解决:
linux环境下修改my.cnf文件

[mysqld]max_allowed_packet = 40M

重启mysql服务

问题二
Error: java.io.IOException: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: The size of BLOB/TEXT data inserted in one transaction is greater than 10% of redo log size. Increase the redo log size using innodb_log_file_size.
解决:
linux环境下修改my.cnf文件

innodb_log_file_size=**

重启mysql服务

InnoDB log file 设置多大合适?参考:http://blog.csdn.net/langkeziju/article/details/51094289

原创粉丝点击