mysql5.7 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.

一、系统环境
操作系统:Windows Server 2008 R2 Enterprise
mysql版本:
导出表结构服务器:Server version: 5.6.26-log MySQL Community Server (GPL)
导如表结构服务器:Server version: 5.7.10-log MySQL Community Server (GPL)
二、问题描述
由mysql5.6导出表结构导入mysql5.7.10时,无法导入
CREATE TABLE `inpatadmission` (
  `PK_ID` INT(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `DE01_00_014_00` VARCHAR(31) DEFAULT NULL COMMENT '住院号(病历号)',
  ... ...

  `TIMESTAMP` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `DATASOURCE_ID` INT(11) DEFAULT NULL,
  `TASK_CONFIG_LOG_ID` INT(11) DEFAULT NULL,
  PRIMARY KEY (`PK_ID`)
) ENGINE=INNODB ROW_FORMAT=COMPRESSED DEFAULT CHARSET=utf8;
报一下错误:
Error Code : 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.
Execution Time : 00:00:00:000
Transfer Time  : 00:00:00:000
Total Time     : 00:00:00:000
三、解决方法
参考解决办法:
1. 打开mysql的配置my.ini。在innodb配置出添加:innodb_file_per_table=1
2. 然后命令检查下上述开关是否打开。
mysql> show variables like '%per_table%';
+-----------------------+-------+
| Variable_name         | Value |
+-----------------------+-------+
| innodb_file_per_table | ON    |
+-----------------------+-------+
1 row in set (0.01 sec)
3. 设置mysql全局变量:innodb_file_format = Barracuda(梭鱼)
命令:set GLOBAL innodb_file_format = ‘Barracuda’;
然后检查下是否设置好了:
mysql> show GLOBAL VARIABLES LIKE '%file_format%';
+--------------------------+----------+
| Variable_name            | Value    |
+--------------------------+----------+
| innodb_file_format       | Antelope |
| innodb_file_format_check | ON       |
| innodb_file_format_max   | Antelope |
+--------------------------+----------+
3 rows in set (0.01 sec)
4. 设置对应表的属性:ROW_FORMAT=COMPRESSED
然后检查下标的属性是否是你设置的:COMPRESSED
5、修改存储引擎(ENGINE)由INNODB修改为MYISAM即可
CREATE TABLE `inpatadmission` (
  `PK_ID` INT(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `DE01_00_014_00` VARCHAR(31) DEFAULT NULL COMMENT '住院号(病历号)',
  ... ...

  `TIMESTAMP` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `DATASOURCE_ID` INT(11) DEFAULT NULL,
  `TASK_CONFIG_LOG_ID` INT(11) DEFAULT NULL,
  PRIMARY KEY (`PK_ID`)
) ENGINE=MYISAM ROW_FORMAT=COMPRESSED DEFAULT CHARSET=utf8;
原因未知,先记下来
四、参考资料