一、 问题描述
提示:具体错误如下
[err] 1118 - 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.
二、 原因分析
与发送sql文件的同事沟通他说可能是他用的mysql版本是5.7的而我用的是8.0的版本的问题,具体是否后边我也没有做验证了
网上搜索的原因大致是说
“在执行创建表或者增加字段时,发现row size长度过长,会导致出现以下错误”
三、 解决方案
1、执行以下sql语句,查看严格模式是否是开启
// 查看严格模式是否是开启(这里在navicat新建查询里运行也是一样的) show variables like '%innodb_strict_mode%';
2、执行后如果为on,则需要关闭
variable_name value innodb_strict_mode on
3、找到mysql的配置文件位置
我的位置如 d:\users\work\software\mysql\mysql data\my.ini,可查看系统变量找到安装目录。
右键编辑,在[mysqld]配置项下面新增一行
//在[mysqld]下面新增 innodb_strict_mode=0
4、保存,然后重启mysql服务
// 再次执行以下sql语句,查看严格模式是否是关闭
show variables like '%innodb_strict_mode%';
variable_name value innodb_strict_mode off
如果为off,则说明执行成功。再导入试试
我就是使用此方法解决,导入就没问题了
总结
以上为个人经验,希望能给大家一个参考,也希望大家多多支持代码网。
发表评论