Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

error 1451 (23000): cannot delete or update a parent row: a foreign key constraint fails

SET FOREIGN_KEY_CHECKS = 0; -- to disable FK checks (ex: for delete purpose)
SET FOREIGN_KEY_CHECKS = 1; -- to re-enable FK checks 
 
PREVIOUS NEXT
Tagged: #error #delete #update #parent #foreign #key #constraint #fails
ADD COMMENT
Topic
Name
1+8 =