MySQL - Cannot add or update a child row: a foreign key constraint fails
This seems to be a common error, but for the life of me I can't figure this out. I have a set of InnoDB user tables in MySQL that are tied together via foreign key; the parent user table, and a set of child tables that store email addresses, actions, etc. These are all tied to the parent user table by a foreign key, uid , with all of the parent and child keys being int(10) . All of the child tables have a uid value with a foreign key constraint pointing to user.uid , and set to ON DELETE CASCADE and ON UPDATE CASCADE . When I delete a user from user , all of the child constrained entries are