博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
mysql错误:Row size too large (> 8126).
阅读量:7235 次
发布时间:2019-06-29

本文共 1109 字,大约阅读时间需要 3 分钟。

mysql版本:mysql 5.6

mysql引擎:默认InnoDB
问题原因:由于一张定义角色信息表有接近300列,并且多数是blog的数据类型,数据存储时报这个错:
Row size too large (> 8126). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help
问题分析:
You may want to take a look at this article which explains a lot about MySQL row sizes. It's important to note that even if you use TEXT or BLOB fields, your row size could still be over 8K (limit for InnoDB) because it stores the first 768 bytes for each field inline in the page.

The simplest way to fix this is to use the Barracuda file format with InnoDB. This basically gets rid of the problem altogether by only storing the 20 byte pointer to the text data instead of storing the first 768 bytes.

解决方法:
1、修改mysql配置文件my.cnf
innodb_file_per_table
innodb_file_format = Barracuda
2、修改造成这个问题的表属性
ALTER TABLE $TABLE
ENGINE=InnoDB
ROW_FORMAT=COMPRESSED
KEY_BLOCK_SIZE=8;
3、重启mysql服务
4、通过写sql语句修改mysql环境配置,可以免重启服务。当然,配置文件中也必须配置上面两个参数,这个操作只是避免此次重启mysql服务
mysql> set global innodb_file_per_table =ON;
mysql> SET GLOBAL innodb_file_format = barracuda;

转载于:https://blog.51cto.com/4708705/2050345

你可能感兴趣的文章
MCMC(四)Gibbs采样
查看>>
分布式计算框架Gearman原理详解
查看>>
你不可不知的安全问题与9大趋势
查看>>
题解 P1339 【[USACO09OCT]热浪Heat Wave】
查看>>
Flask從入門到入土(一)——程序的基本結構
查看>>
Windows 10不能正常打开开始菜单问题修复
查看>>
7.73 亿 email 信息泄露,你的密码可能在里边
查看>>
JFinal-layui v1.1 更新,极速开发企业应用系统
查看>>
部署WAR包实时查看Tomcat的状态和日志
查看>>
vex使用...mapActions报错解决办法
查看>>
胡捷:区块链是促进个体信任的“天使”,也是消减中心权利的“魔鬼”
查看>>
使用docker-compose快速搭建zookeeper集群
查看>>
TFC暨智能娱乐展乐相科技陈朝阳致开发者:为什么你要信任虚拟现实
查看>>
深入解读HBase2.0新功能之高可用读Region Replica
查看>>
Linux中KVM虚拟机是什么
查看>>
「镁客·请讲」Lucia 焦玉龙:用区块链技术切入长租行业,Lucia要做长租领域的变革者...
查看>>
【加法笔记系列】逻辑门、半加器、全加器、波纹进位加法器
查看>>
递归基础思想
查看>>
通过组策略禁止有本地管理员权限的域用户更改网络配置
查看>>
git revert和reset区别
查看>>