Mysql删除表提示Cannot truncate a table referenced in a foreign key constraint解决办法
2020-6-16 dingshangchao 数据库
执行truncate table xxx时提示:
[Err] 1701 -Cannot truncate a table referenced in a foreign key constraint ….
解决办法:
删除之前先执行删除外键约束
SET foreign_key_checks = 0
删除完之后再执行启动外键约束
SET foreign_key_checks = 1
标签: 数据库