qqruser 发表于 2018-9-28 14:14:45

mysql中的外键使用

mysql> update child set parent_id=4 where parent_id=2;  ERROR1452 (23000): Cannot add or update a child row: a foreign keyconstraint fails (`test/child`,            CONSTRAINT `child_ibfk_1`FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`) ON DELETE CASCADE)

页: [1]
查看完整版本: mysql中的外键使用