mysql导入报错
比较老的系统生成的数据库导入5.7时报错[Err] 1067 - Invalid default value for 'create_time'
- 先查询
select @@global.sql_mode;
# 结果
ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
# 删除 NO_ZERO_DATE
set global sql_mode = 'ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';
- 重启mysql 再次导入
Table storage engine for doesn't have this option on order by query (ERROR 1031)[mysqld]
innodb_strict_mode=off
- 添加后重启
[mysqld]
innodb_strict_mode=off