mysql cannot delete or update a parent row
# THIS SHOULD ONLY BE USED AS A LAST RESORT
SET FOREIGN_KEY_CHECKS=0; -- to disable them
SET FOREIGN_KEY_CHECKS=1; -- to re-enable them
mysql cannot delete or update a parent row
# THIS SHOULD ONLY BE USED AS A LAST RESORT
SET FOREIGN_KEY_CHECKS=0; -- to disable them
SET FOREIGN_KEY_CHECKS=1; -- to re-enable them
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
Cannot delete or update a parent row: a foreign key constraint fails (
ALTER TABLE "appointments" DROP FOREIGN KEY "appointments_user_id_foreign";
ALTER TABLE "appointments" ADD CONSTRAINT "appointments_user_id_foreign" FOREIGN KEY ("user_id") REFERENCES "users" ("id") ON DELETE CASCADE;
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
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us