외래키(foreign key)를 사용하여 종속성이 생겼을 경우 아래와 같은 에러메세지를 띄우면서 삭제가 안되는 경우 ERROR 1451 (23000): Cannot delete or update a parent row: a foreign key constraint fails (`glance`.`image_locations`, CONSTRAINT `image_locations_ibfk_1` FOREIGN KEY (`image_id`) REFERENCES `images` (`id`))
:: 외래키 검사 일시 종료 mysql> SET foreign_key_checks = 0;
:: 외래키 검사 시작 mysql> SET foreign_key_checks = 1;
|