MySQL Forums
Forum List  »  InnoDB

Re: ERROR 1005: Can't create table (errno: 121) Help
Posted by: Fred Riley
Date: May 05, 2006 10:49AM

Thanks for this reply, Heikki, which has finally cleared up what, for me, has been a persistent and very irritating problem (I posted a message about the same error myself at http://forums.mysql.com/read.php?10,75803,75803#msg-75803). I was trying to create foreign key constraints in mySQL Administrator (I don't have access to the command line on our mySQL server) and running into the same problem because, I now know, I was using the same foreign key names on different tables. For instance, I'd try to create a FK called "fk_person_num" when another table had a FK of the same name, and unknown to me this was causing a name conflict.

So based on your advice, and that of "wenbo fan" who posted a reply to my query, the solution appears to be to not use your own name for a foreign key but to accept the defaults proposed by mySQL Administrator, eg FK_RLO_DEVELOPER_1. That's now worked fine for me in all cases. For those who don't use GUI tools but work from the command line, they need to ensure that FK names are unique in the database.

Maybe this ought to be posted as a FAQ? When I searched the fora for "errno: 121" there were plenty of hits so this is plainly a common problem that people run into.

Fred

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: ERROR 1005: Can't create table (errno: 121) Help
39910
May 05, 2006 10:49AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.