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.

解决办法:

  1. mysql> show create table customer; //查看表是COMPACT模式  
  2.   
  3. CREATE TABLE `customer` (  
  4. 。。。。。。。。。。。。。。。。。。省略。。。。。。。。。。。。。。。。。。  
  5. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=COMPACT COMMENT='消费';  
  6.   
  7. # vim /etc/my.cnf  //修改配置  
  8.   
  9. [mysqld]  
  10. innodb_file_format = Barracuda //mysqld下添加  
  11.   
  12. # systemctl restart mysqld  //重启  
  13.   
  14. # mysql> alter table customer ROW_FORMAT=DYNAMIC; //修改row_format  


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