跟老师的一样,为什么会报错!
mysql> DELETE FROM works2 WHERE id=3;
ERROR 1451 (23000): Cannot delete or update a parent row: a foreign key constraint fails (`work1`.`works3`, CONSTRAINT `works3_ibfk_1` FOREIGN KEY (`pid`) REFERENCES `works2` (`id`))
mysql> DELETE FROM works2 WHERE id=3;
ERROR 1451 (23000): Cannot delete or update a parent row: a foreign key constraint fails (`work1`.`works3`, CONSTRAINT `works3_ibfk_1` FOREIGN KEY (`pid`) REFERENCES `works2` (`id`))
2019-10-08
举报