导入SQL文件时报错(在执行创建表或者增加字段时,发现row size长度过长,会导致出现以下错误)
[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.
[ERR] -- MySQL dump 10.13 Distrib 5.6.50, for Linux (x86_64)
执行以下SQL语句,查看严格模式是否开启
show variables like '%innodb_strict_mode%';
执行后如果为ON
,则需要关闭
Variable_name Value
innodb_strict_mode ON
找到MySQL的配置文件位置,如C:\Program Files\MariaDB 10.6\data\my.ini
,可查看系统变量找到安装目录。
右键编辑,在[mysqld]配置项下面新增一行
[mysqld]
innodb_strict_mode=0
保存,然后重启服务。再次执行以下SQL语句,查看严格模式是否开启
show variables like '%innodb_strict_mode%';
如果为OFF,则说明执行成功。再导入试试
[mysqld]
#处理 MySQL导入数据库1118错误解决方案[ERR] 1118 - Row size too large (> 8126). Changing some columns to TEXT or BLOB
innodb_strict_mode=0
# 设置3306端口
port=3306
# 设置mysql的安装目录
basedir=H:\Soft_Ware\Develop_SoftWare\mysql-8.0.21-winx64
# 设置mysql数据库的数据的存放目录
datadir=H:\Soft_Ware\Develop_SoftWare\mysql-8.0.21-winx64\Data
# 允许最大连接数
max_connections=200
# 允许连接失败的次数。
max_connect_errors=10
# 服务端使用的字符集默认为utf8mb4
character-set-server=utf8mb4
# 创建新表时将使用的默认存储引擎
default-storage-engine=INNODB
# 默认使用“mysql_native_password”插件认证
#mysql_native_password
default_authentication_plugin=mysql_native_password
# 关于Mysql创建函数报错This function has none of DETERMINISTIC, NO SQL, 的解决方案
log-bin-trust-function-creators=1
# 解决 group by 问题
sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION
#sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
[mysql]
# 设置mysql客户端默认字符集
default-character-set=utf8mb4
[client]
# 设置mysql客户端连接服务端时默认使用的端口
port=3306
default-character-set=utf8mb4
为人:谦逊、激情、博学、审问、慎思、明辨、 笃行
学问:纸上得来终觉浅,绝知此事要躬行
为事:工欲善其事,必先利其器。
态度:道阻且长,行则将至;行而不辍,未来可期
转载请标注出处!