[Err] 1067 - Invalid default value for 'create_time'

mysql导入报错

比较老的系统生成的数据库导入5.7时报错[Err] 1067 - Invalid default value for 'create_time'

  1. 先查询
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';

  1. 重启mysql 再次导入

Table storage engine for doesn't have this option on order by query (ERROR 1031)
[mysqld]

innodb_strict_mode=off
  • 添加后重启

posted on 2020-04-10 11:46  何苦->  阅读(2078)  评论(0编辑  收藏  举报

导航