今天导入之前从mysql5.7备份的数据至mysql8.0.30,一直报错:
ERROR 1118 (42000) at line 42931704: 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.
经过反复测试验证,修改my.ini中配置,保证下面四个属性,可0错误,正确导入
innodb_file_per_table=1
innodb_default_row_format=DYNAMIC
innodb_strict_mode=OFF
innodb_page_size=16k
其中innodb_file_per_table=1和innodb_page_size=16k应该是mysql8.0默认配置,不配置应该也是可以的,我的文件太大,导入一次要好长时间,没再做验证。报这个错误的原因,网上讨论的挺多的,不再赘述了。