如果报:
--- Cause: com.mysql.jdbc.PacketTooBigException: Packet for query is too large (1052876 > 1048576). You can change this value on the server by setting the max_allowed_packet' variable.
com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeUpdate(GeneralStatement.java:91)
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.insert(SqlMapExecutorDelegate.java:447)
就需要修改(参见
http://dev.mysql.com/doc/refman/5.0/en/packet-too-large.html)
for example, if you are working with big BLOB columns). For example, to set the variable to 16MB, start the server like this:
The server's default max_allowed_packet value is 1MB.
You can increase this if the server needs to handle big queries
(for example, if you are working with big BLOB columns).
For example, to set the variable to 16MB, start the server like this:
1。启动mysql的时候加命令:
shell> mysqld --max_allowed_packet=16M
2。或在my.ini中加入:
[mysqld]
max_allowed_packet=16M
注意这里是在mysqld下添加这句话的。官方也提倡这种办法。
It is safe to increase the value of this variable because the extra memory
is allocated only when needed. For example, mysqld allocates more memory only
when you issue a long query or when mysqld must return a large result row.
The small default value of the variable is a precaution to catch incorrect
packets between the client and server and also to ensure that you do not run out
of memory by using large packets accidentally.
分享到:
相关推荐
blob类型的数据从orcale数据库中读取出来
使用环境是VS2010,往SQLite数据库的BLOB字段里插入jpg,主要修改路径和文件名也可以换成其他文件。工程里也自带SQLite的编译文件,如果需要的也可以下载。
SQLSERVER数据库中存储BLOB类型数据,在线等现在公司要求用PB6.5+SQLser
向orcale数据库中插入blob类型的数据,插入一张图片的示例,由于本人在完成时遇到了很多问题,最终解决了,于是整理下来,方便学习交流
Oralce 保存与读取Blob类型文件
kettle通过java代码将数据库blob 字段抽取到本地文件
图片BASE64加密保存到数据库Blob类型中(放入数据库,并取出生成图片),完整的demo例子,可运行。
java中sqllite数据库blob数据类型的存取.docx
C# oracle blob类型 读入与保存
常用文件流下载文件( Blob)时各种类型文件的 type
.NET向orcale数据库中插入blob(图片)类型 C#向orcale数据库插入和读取图片 .NET向orcale数据库插入图片 .net向orcale数据库操作blob数据 建表语句CREATE TABLE PIC(PICT BLOB ) 说明:如果打不开直接看Form1.cs,两...
Blob类型数据讲解会用到的数据库
只需要安装oracle client在本地,然后配置好tns,输入连接名,用户名,密码,数据表的名称,文件名数据列名以及blob数据列名,就可以批量导出ORACLE数据库BLOB字段生成图片
向数据库插入blob数据实例源码.rar 在mysql中通过。
可以从数据库中读取blob字段并插入到另一个表中,已经测试通过
Mybatis 处理 CLOB、BLOB 类型数据
Blob是一个类文件的不可变的原始数据对象,非javascript原生数据类型,File对象就是继承自Blob对象,且在Blob的基础上进行扩展,以便支持用户系统上的文件。 前言 最近在做以post请求方式导出excel时,想到了可以...
blob 类型写入数据库通过操作文件处理
jsp操作mysql数据库的blob字段,实现: 1、将磁盘文件存入mysql数据库; 2、将mysql数据库中存入的文件,读出来,输出给浏览器。
按照id下载存放在oracle数据库的blob字段中的内容。