往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. leetcode NO.171 Excel表列序号 (python实现)

    来源 https://leetcode-cn.com/problems/excel-sheet-column-number/description/ 题目描述 给定一个Excel表格中的列名称,返回其 ...

  2. Spring整合hibernate -SessionFactory

    本文目录 1  本文采用 hibernate4 整合 Spring3.1 2 把Spring获取datasource通过class="org.springframework.orm.hibe ...

  3. zookeeper Zookeeper

    这是ZooKeeper客户端库的主要类.使用一个ZooKeeper服务,应用程序必须首先实例化ZooKeeper类的对象.所有的迭代都将通过调用ZooKeeper类的方法来完成.除非另有说明,该类的方 ...

  4. HDFS设计思想

    HDFS设计思想 DataNode:用来在磁盘上存储数据 HDFS  数据存储单元( block ) 1 文件被切分成固定大小的数据block块 •默认数据块大小为 64MB(hadoop1.x版本6 ...

  5. Linux系统——机制策略(一)

    机制策略(一) 形而上谓之道:形而下谓之器: ————易经 LinuxUnix设计理念提供的一种机制不是策略:1.如果说机制是一种框架,那么,策略就是填充框架的一个个具体实施.机制提供的就是一种开放而 ...

  6. MFC 禁用输入法

    #include <Imm.h> HIMC m_hImc; // 全局或者成员变量 // Function for Disabling IME void CMyDialog::Disabl ...

  7. 移动端页面a input去除点击效果及pc端切换

    1 手机端页面a button input去除点击效果以及闪屏问题 添加: a, button, input { -webkit-tap-highlight-color: rgba(255, 0, 0 ...

  8. client、offset、scroll

    1. client 客户区大小 1.1. clientHeight和clientWidth element.clientHeight表示元素可视区域的高度,包括可视区域中元素的 CSS height+ ...

  9. poj 2836 Rectangular Covering

    Rectangular Covering Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 2776   Accepted: 7 ...

  10. JavaScript中in的用法

    JavaScript中的in 操作符是对Object(对象)操作的,并不是针对数组. in 的右边必须是对象变量 例如:var data = {id:1, name:'AAA'};if('name' ...