MySql的MyISAM引擎切换InnoDB时报错Row size too large (> 8126)

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.

Row size too large (> 8126)报错也可能发生在添加字段时,行大小不够了,可以把行大小改大来解决。

在线修改,重启配置失效

# 查看配置
show variables like '%innodb_strict_mode%';
show variables like '%innodb_log_file_size%';
# 修改配置
set GLOBAL innodb_strict_mode=0
set GLOBAL innodb_log_file_size=128M

如果提示该变量只读,则需要从修改配置文件重启/etc/my.cnf

修改配置,重启生效

innodb_strict_mode = 0
innodb_log_file_size = 128M

修改表引擎

alter table 表名 engine=innodb;