Mysql删除表提示Cannot truncate a table referenced in a foreign key constraint解决办法
来源:互联网 发布:知乎 修改一句话介绍 编辑:程序博客网 时间:2024/06/04 20:35
背景
因为测试过程中,几套环境都是用的同一个库,数据有点冲突,需要删库。
执行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
阅读全文
0 0
- Mysql删除表提示Cannot truncate a table referenced in a foreign key constraint解决办法
- ERROR 1701 (42000): Cannot truncate a table referenced in a foreign key constraint
- mysql Error : Cannot truncate a table referenced in a foreign key constraint 清空具有外键约束的表时报
- Cannot add or update a child row: a foreign key constraint fails (`mysql`.`ordermx`, CONSTRAINT `kf
- linux系统mysql删除一行报错:Cannot delete or update a parent row: a foreign key constraint fails
- #1451 - Cannot delete or update a parent row: a foreign key constraint fails 问题的解决办法
- Cannot add or update a child row: a foreign key constraint fails 解决办法
- 表删除时Cannot delete or update a parent row: a foreign key constraint fails 异常处理
- 表删除时 Cannot delete or update a parent row: a foreign key constraint fails 异常处理
- 表删除时 Cannot delete or update a parent row: a foreign key constraint fails 异常处理
- 表删除时 Cannot delete or update a parent row: a foreign key constraint fails 异常处理
- 级联删除报Cannot delete or update a parent row: a foreign key constraint fails解决方法
- [MySQL]MYSQL: Cannot delete or update a parent row: a foreign key constraint fails
- Mysql error 1452 - Cannot add or update a child row: a foreign key constraint fails
- MYSQL "Cannot delete or update a parent row: a foreign key constraint fails "
- MySQL错误号1451-Cannot delete or update a parent row: a foreign key constraint fails
- MYSQL: Cannot delete or update a parent row: a foreign key constraint fails
- Mysql error 1452 - Cannot add or update a child row: a foreign key constraint fails
- 数值计算和SVM讲解(下)
- apache tomat安装
- (关系幂运算->n长度的最短路)河南省第十届ACM省赛题目:问题 I: Transmit information
- HDU 5545 The Battle of Guandu(最短路)
- WebService的基本介绍和调用实例
- Mysql删除表提示Cannot truncate a table referenced in a foreign key constraint解决办法
- A Concise and Provably Informative Multi-Scale Signature Based on Heat Diffusion
- 继承中的final/super关键字、Object类
- Spring MVC 属性文件读取注入到静态字段
- 【九度OJ】1193:矩阵转置
- 20179.4,考虑置信区间数据清洗和结果均值检测
- 在所有四位二进制(从0000至1111)中,数字0和1数目相同的数占——%?
- ArcEngine开启编辑功能的三种方法
- oracle报错oracle not available原因及解决办法