Recently I received the following error while trying to create a table:
MySQL error code 121: Duplicate key on write or update
After a bit of research I discovered that the problem was that I had two foreign keys with the same name in the database. Rename one of them and then you're sorted!