mysql Row size too large (> 8126)

张映 发表于 2020-12-30

分类目录: mysql

标签:

一张表longtext字段比较多,导入数据时报错如下:

Row size too large (> 8126). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline.

解决办法:

mysql> show create table customer; //查看表是COMPACT模式

CREATE TABLE `customer` (
。。。。。。。。。。。。。。。。。。省略。。。。。。。。。。。。。。。。。。
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=COMPACT COMMENT='消费';

# vim /etc/my.cnf  //修改配置

[mysqld]
innodb_file_format = Barracuda //mysqld下添加

# systemctl restart mysqld  //重启

# mysql> alter table customer ROW_FORMAT=DYNAMIC; //修改row_format


转载请注明
作者:海底苍鹰
地址:http://blog.51yip.com/mysql/2471.html