[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_TABLES

 2.在配置文件中添加使用独立表空间的配置:innodb_file_per_table=1

 3.在数据库中执行:SHOW GLOBAL VARIABLES LIKE '%innodb_file%';

+--------------------------+-----------+
| Variable_name            | Value     |
+--------------------------+-----------+
| innodb_file_format       | Barracuda |
| innodb_file_format_check | ON        |
| innodb_file_format_max   | Barracuda |
+--------------------------+-----------+

  确保innodb_file_format 使用的是Barracuda,如果不是执行以下语句:SET GLOBAL innodb_file_format = barracuda;

 此时,即可解决mysql报错1118的问题。

以下是问题图片:

posted @ 2019-03-21 09:18  真爱和自由  阅读(8152)  评论(1编辑  收藏  举报