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;
Even though this is pretty old, just chiming in to say that what is useful in @Sidupac's answer is the FOREIGN_KEY_CHECKS=0.
This answer is not an option when you are using something that manages the database schema for you (JPA in my case) but the problem may be that there are "orphaned" entries in your table (referencing a foreign key that might not exist).
This can often happen when you convert a MySQL table from MyISAM to InnoDB since referential integrity isn't really a thing with the former.