Answers for "1 - Cannot delete or update a parent row: a foreign key constraint fails"

1

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
Posted by: Guest on March-21-2021
0

1 - Cannot delete or update a parent row: a foreign key constraint fails

SET FOREIGN_KEY_CHECKS=0; -- to disable them
DELETE FROM `jobs` WHERE `job_id` = 1 LIMIT 1 
SET FOREIGN_KEY_CHECKS=1; -- to re-enable them
Posted by: Guest on October-22-2021
0

ERROR 1451: 1451: Cannot delete or update a parent row: a foreign key constraint fails

SET FOREIGN_KEY_CHECKS=0; -- to disable them
SET FOREIGN_KEY_CHECKS=1; -- to re-enable them
Posted by: Guest on September-20-2021

Code answers related to "1 - Cannot delete or update a parent row: a foreign key constraint fails"

Browse Popular Code Answers by Language