关闭外键约束:
SET FOREIGN_KEY_CHECKS=0;
启动外键约束:
SET FOREIGN_KEY_CHECKS=1;
查看当前FOREIGN_KEY_CHECKS的值:
SELECT @@FOREIGN_KEY_CHECKS;