MySQL 5.1.48 导入 MySQL 5.7.18 时遇到 T FOREIGN_KEY_CHECKS = 0 错误的解决方法

#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 ‘T FOREIGN_KEY_CHECKS = 0’ at line 1

经查询,这个是 mysql 启动和关闭外键约束的方法,去掉即可。

编辑数据库文件:

//去掉此行
SET FOREIGN_KEY_CHECKS = 0;

//去掉此行
SET FOREIGN_KEY_CHECKS = 1;

然后重新导入即可。

来源:https://blog.csdn.net/ggrjake25/article/details/86586302