1118 Row size too large

Every table (regardless of storage engine) has a maximum row size of 65,535 bytes.
Storage engines may place additional constraints on this limit, reducing the effective maximum row size.

innodb_version : 5.5.56

Like other InnoDB tables it has all the InnoDB limitations, i.e.,
InnoDB row or column limits. If it exceeds these, it will return “Row size too large” or “Too many columns” errors.
The workaround is to set internal_tmp_disk_storage_engine to MYISAM.

提供3种解决途径 (根据需要选其一即可),我采用的是第3种方法

1.innodb_log_file_size innodb_log_file_size = 500M innodb_strict_mode = 0
2.storage_engine = MyISAM
3.innodb_file_per_table=ON innodb_file_format = Barracuda internal_tmp_disk_storage_engine=MyISAM

  • 按照第3种方法修改配置文件
  • 修改全局变量 set global innodb_file_format  = 'Barracuda'
  • 修改表文件存储方式  alter table table_name ENgine = 'innodb' ROW_FORMAT = COMPRESSED KEY_BLOCK_SIZE=8 ;
  • 完成

下面是一些调试语句,可以选择性使用
innodb_log_file_size = 5120M (5242880)
innodb_strict_mode = off
innodb_file_per_table = ON

show variables like "%format%";

innodb_file_format Barracuda
innodb_file_format_max Barracuda

show table status like '%table_name%';
row_format compact

alter table table_name ENgine = 'innodb' ROW_FORMAT = COMPRESSED KEY_BLOCK_SIZE=8 ;

show table status like '%table_name%';
row_format compressed

fixed-length dynamic-length compress

InnoDB Plugin引入了新的文件格式(file format,可以理解为新的页格式),
对于以前支持的Compact和Redundant格式将其称为Antelope文件格式,
新的文件格式称为Barracuda。Barracuda文件格式下拥有两种新的行记录格式Compressed和Dynamic两种。
新的两种格式对于存放BLOB的数据采用了完全的行溢出的方式,在数据页中只存放20个字节的指针,实际的数据都存放在BLOB Page中,
而之前的Compact和Redundant两种格式会存放768个前缀字节。

Compressed行记录格式的另一个功能就是,存储在其中的行数据会以zlib的算法进行压缩,
因此对于BLOB、TEXT、VARCHAR这类大长度类型的数据能进行非常有效的存储。

提供另外2中思路

  • 分表,把复杂的字段提取出来单独存放
  • 能否从代码层面规避这种问题,通过代码优化实现

【bug】 1118 Row size too large的更多相关文章

  1. mysql触发器应用和创建表错误代码: 1118 Row size too large. 解决

    1.针对数据库查询问题的方便,可以建立重要表的log备份记录表,在主表的添加,修改,删除添加触发器,修改触发器增加触发字段的点,限制条件. 数据库log表查问题比从线上多台服务器上下载日志文件相对方便 ...

  2. Mysql [Err] 1118 - Row size too large

    首先声明,对MySQL不懂,很多都不知道原因 设计了一个表,里面很多text字段,然后填进去的东西太多(用的是Python的MySQLdb),报错: _mysql_exceptions.Operati ...

  3. Mysql [Err] 1118 - Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535.

    对于越来越多的数据,数据库的容量越来越大,压缩也就越来越常见了.在我的实际工作中进行过多次压缩工作,也遇到多次问题,在此和大家分享一下. 首先,我们先说说怎么使用innodb的压缩. 第一,mysql ...

  4. [ERR] 1118 - Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.

    昨天,在测试新的数据库时,迁移表遇到了这个问题.现在记录一下解决方案. 1.在配置文件中添加关闭严格模式的配置:sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS ...

  5. Mysql_大字段问题Row size too large.....not counting BLOBs, is 8126.

    [问题描述] 1.从myslq(5.7.19-0ubuntu0.16.04.1)中导出sql脚本,导入到mysql(5.5.27)中,报如下错误:Row size too large. The max ...

  6. mysql 报Row size too large 65535 原因与解决方法

    报错信息:Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535 ...

  7. 【BUG】12小时制和24小时制获取当天零点问题

    [BUG]12小时制和24小时制获取当天零点问题 最近在写定时服务的时候,要获取当天的零点这个时间,但是是这样获取的 DateTime dt = DateTime.Parse(DateTime.Now ...

  8. 【概率论】6-1:大样本介绍(Large Random Samples Introduction)

    title: [概率论]6-1:大样本介绍(Large Random Samples Introduction) categories: - Mathematic - Probability keyw ...

  9. MySQLSyntaxErrorException: Row size too large 转摘自:https://confluence.atlassian.com/display/CONFKB/MySQLSyntaxErrorException%3A+Row+size+too+large

    Symptoms The following appears in the atlassian-confluence.log: Caused by: com.mysql.jdbc.exceptions ...

随机推荐

  1. mysql 巧用存储过程

    根据距离排序 CREATE DEFINER=`ln` PROCEDURE `Proc_4`(IN `lon1` double,IN `lat1` double,IN `PageStart` int,I ...

  2. [软件工程基础]2017.11.02 第六次 Scrum 会议

    具体事项 燃尽图 每人工作内容 成员 已完成的工作 计划完成的工作 工作中遇到的困难 游心 #10 搭建可用的开发测试环境:#9 阅读分析 PhyLab 后端代码与文档:#8 掌握 Laravel 框 ...

  3. Qt 2D绘图之五:图形视图框架的结构和坐标系统

    一.图形视图框架的结构 在前面讲的基本绘图中,我们可以自己绘制各种图形,并且控制它们.但是,如果需要同时绘制很多个相同或不同的图形,并且要控制它们的移动.检测它们的碰撞和叠加:或者我们想让自己绘制的图 ...

  4. Codeforces Round #497 (Div. 2) C. Reorder the Array

    Bryce1010模板 http://codeforces.com/contest/1008/problems #include <bits/stdc++.h> using namespa ...

  5. compile and link

    1. C 中 头文件的作用? 2. difference between *.a and *.so? 3. object file and executable file 4. search path ...

  6. Javaoo学习数组

  7. 前端之Html元素的分类

    一.html元素可分为三大类:块元素.内联元素.可变元素 1.块元素: 常见块状元素:div,p,ul,ol,li,dl,dt,dd,form,hr,table,tr,td,h1-h6,filedse ...

  8. JVM垃圾回收机制二

    对象的回收 垃圾的回收涉及的几个问题:何时回收,由谁回收,怎样回收.这几个问题我们一一来解决. 1.何时回收----对象的生死判定 对象达到什么条件才能判断这个对象已经无用了.常见的判断对象生死的方法 ...

  9. 重新安装Magento2 Module

    如何重新安装Magento2的Module? 分类 2 类: Module是通过 composer 安装的:在命令行输入:php bin/magento module:uninstall Module ...

  10. 原来MFC窗口样式随字符集而改变

    以前好像发现,MFC窗口上按钮的自动样式有时是有亮色边框3D效果的,有时没有,不知道原因,也没有追究,今天正好有机会发现了原因,原来是随字符集而改变的. 1.Unicode版本下的窗口 2.未设置的窗 ...