往MySQL的blob字段上传文件,结果又出现了Data truncation: Data too longData truncation: Data too long异常。

我的第一反应是查看/etc/my.cnf中的max_allowed_packet设置,以为建立数据库时忘了,结果文件里明白写着max_allowed_packet = 30M,可以真上传时仅仅允许10K左右的文件啊。

于是在网上找答案,看到了这个帖子:

http://bbs.csdn.net/topics/110011776

里面提出JSP,数据库,表的字段都应该统一为uft8,我一看,都是设置好了的。

在36楼,解决问题的答复终于出现了:

"我这边也出现了这样的问题,字符编码都是utf-8 ,最后发现数据库的字段为blob 类型,只能存储65k大小的内容,将字段类型设为longblob  就ok了。"(作者ID:Lenovo910205)

我照做然后正常了。

附带说一下,我MySQL数据库的版本是mysql-server-5.1.73-3.el6_5.x86_64.

又一次遇到Data truncation: Data too longData truncation: Data too long问题的更多相关文章

  1. SSIS Data Flow 的 Execution Tree 和 Data Pipeline

    一,Execution Tree 执行树是数据流组件(转换和适配器)基于同步关系所建立的逻辑分组,每一个分组都是一个执行树的开始和结束,也可以将执行树理解为一个缓冲区的开始和结束,即缓冲区的整个生命周 ...

  2. Data Being Added Conflicts with Existing Data

    While developing a page with multiple scrolls levels, and especially when using a grid, you may get ...

  3. Competing in a data science contest without reading the data

    Competing in a data science contest without reading the data Machine learning competitions have beco ...

  4. Big Data Analytics for Security(Big Data Analytics for Security Intelligence)

    http://www.infoq.com/articles/bigdata-analytics-for-security This article first appeared in the IEEE ...

  5. data Mining with Weka: Trailer More Data Mining with Weka 用weka 进行数据挖掘 Weka 用weka 进行更多数据挖掘

    https://www.youtube.com/user/WekaMOOC 大学公开课  视频教程 weka 入门教程 data Mining with Weka: Trailer  More Dat ...

  6. Coursera, Big Data 4, Machine Learning With Big Data (week 1/2)

    Week 1 Machine Learning with Big Data KNime - GUI based Spark MLlib - inside Spark CRISP-DM Week 2, ...

  7. Use Dynamic Data Masking to obfuscate your sensitive data

    Data privacy is a major concern today for any organization that manages sensitive data or personally ...

  8. 背水一战 Windows 10 (91) - 文件系统: Application Data 中的文件操作, Application Data 中的“设置”操作, 通过 uri 引用 Application Data 中的媒体

    [源码下载] 背水一战 Windows 10 (91) - 文件系统: Application Data 中的文件操作, Application Data 中的“设置”操作, 通过 uri 引用 Ap ...

  9. Data Provider 中没有.net framework Data provider for Mysql 的解决方法

    近来做的一个项目中,数据库用的是 MySql, 而在项目使用 Entity Data Model 来做数据服务层,可是在项目中添加 Data Entty Model 时,一般我们都会选择从数据库中直接 ...

随机推荐

  1. js的trim方法

    ie9以前版本,不支持string.trim()方法 所以需要自己实现. <script type="text/javascript"> String.prototyp ...

  2. 【bzoj4999】This Problem Is Too Simple! 树链剖分+动态开点线段树

    题目描述 给您一颗树,每个节点有个初始值. 现在支持以下两种操作: 1. C i x(0<=x<2^31) 表示将i节点的值改为x. 2. Q i j x(0<=x<2^31) ...

  3. C#中找不到MouseWheel事件的解决办法

    在.....Designer.cs中加入 this.pictureBox1.MouseWheel += new System.Windows.Forms.MouseEventHandler(this. ...

  4. PIC单片机之时钟设置

    PIC单片机之时钟设置 http://blog.csdn.net/superanters/article/details/8541650 内部时钟和外部时钟? PIC单片机有许多型号可以设置成 用外部 ...

  5. hihoCoder offer 收割编程练习赛 83 C 播放列表

    题目 用 $1,2 ,3 \dots, N$ 代表 $N$ 首歌.设想有 $L$ 个格子排成一排,编号 $1$ 到 $L$ .考虑将这些数字挨个填进格子里的情形.假设当前要往第 $i$ 个格子里填一个 ...

  6. http2新特性

    1.二进制分帧   http1.x是文本格式传输,http2二进制格式传输,并且被切分未过个帧发送,帧可以根据头部流标识重新组装.   2. 单一长连接   同一个域名使用一个TCP连接,(http1 ...

  7. codechef May Challenge 2016 FORESTGA: Forest Gathering 二分

    Description All submissions for this problem are available. Read problems statements in Mandarin Chi ...

  8. mac 安装 homebrew 配置

    前言:刚开始转换系统可能安装各种软件继续中... 1. 打开 Mac 中的命令行工具(终端) 2. 在打开的命令行工具中输入如下语句: ruby -e "$(curl --insecure ...

  9. js数据类型判断

    在一般情况下使用typeof 但是有时候typeof返回的结果都是object,比如数组和json对象的时候,这个时候需要用到 instanceof了 还有一个更好得办法,Object.prototy ...

  10. 添加一种emit的应用,反射发出,较直接调用稍慢,但好过反射与表达式树。

    System.Reflection.MethodInfo mInfo = typeof(TypeParse).GetMethod("Add", System.Reflection. ...