将sql文件导入Navicat里时报错1064(You have an error in your SQL syntax, check the manual that corresponds...)

运行时报错:[ERR] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(0) NULL DEFAULT NULL COMMENT ‘创建时间’,

update_by varchar(64) CHARACT’ at line 14
将sql文件导入Navicat里时报错1064(You have an error in your SQL syntax, check the manual that corresponds...)

细看可以把错误分为两点:
  1. 版本问题出现的错误,跟line14里的问题有关,但是不一定只有这个
  2. line14里的错误,也许在其他版本里没错,但是同样格式在这个版本会报错

先看看line14里是什么:
一查发现,是创建时间里的datetime新版本里不用再加(0)了。将sql文件导入Navicat里时报错1064(You have an error in your SQL syntax, check the manual that corresponds...)
然后ctrl+R替换全部,将datetime(0)全部替换成datetime

然后版本问题,将文件中的所有
utf8mb4_0900_ai_ci替换为utf8_general_ci
utf8mb4替换为utf8

保存文件,运行成功,关闭。
将sql文件导入Navicat里时报错1064(You have an error in your SQL syntax, check the manual that corresponds...)