SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MO
This answer comes from the comment to the answer from @Michael Berkowski. I post it as an answer as it actually worked for me:
I was getting the errno 121 even after changing the constraint names across multiple tables. The problem was that even across different tables you cannot have the same constraint name. I was using
fk_entryidintable1andtable2and had to change them tofk_table1_entryidandfk_table2_entryidrespectively to make it work.