12
如何截断外键约束表?
为什么没有一个TRUNCATE上mygroup工作?即使ON DELETE CASCADE SET我知道了: 错误1701(42000):无法截断在外键约束中引用的表(mytest。instance,CONSTRAINT instance_ibfk_1FOREIGN KEY(GroupID)参考mytest。mygroup(ID)) drop database mytest; create database mytest; use mytest; CREATE TABLE mygroup ( ID INT NOT NULL AUTO_INCREMENT PRIMARY KEY ) ENGINE=InnoDB; CREATE TABLE instance ( ID INT NOT NULL AUTO_INCREMENT PRIMARY KEY, GroupID INT NOT NULL, DateTime DATETIME DEFAULT NULL, FOREIGN KEY (GroupID) …