Cannot delete or update a parent row: a foreign key constraint fails (table1.user_role, constraint fk143bf46a8dsfsfds@#5a6bd60 foreign key (user_id) references user (id))what i did in two simple steps . first i delete the child row in child table like. If you have inserted a row into table 1 before creating the foreign key in table 2, then you will get a foreign key constraint error, because the auto increment value is 2 in table 1 and 1 in table 2.. Can't drop table: a foreign key constraint fails. ask question. up vote 40 #1217 - cannot delete or update a parent row: a foreign key constraint fails. how do i drop this table? mysql sql drop asked jun 19 '12 at 12:26. roy. 206 1 3 4. 2. find out what other table is referencing it via foreign key, and first drop the fk constraint on.
Caused by: java.sql.batchupdateexception: cannot delete or update a parent row: a foreign key constraint fails (`eportal3/employee_passport`, constraint `fkf2967a831229d0e0` foreign key (`employee_id`) references `employee`. Alter table posts add foreign key (post_by) references members(id) on delete cascade when i delete a record from "posts" it works fine and all records from "images" related to it are deleted as they should, but when i delete a record from "members" it throws me this error:. Cannot delete or update a parent row: a foreign key constraint fails. monkey den. september 08, 2006 02:13am.