MySQL Forums
Forum List  »  MySQL Workbench

InnoDB error with FKs
Posted by: Ricardo Umans
Date: November 27, 2012 09:29AM

Hello everybody
I have got a problem while creating my database with InnoDB.
I have tried to find the solution in other topics but I don't understand what a solution would be.
I am using the Create Table function and try to make FKs with the PK in table users called 'user_id'. I already made a few FKs to this id without any problems but now I get error 1005 that the table can't be created due to the FK. (InnoDB errno 121)
Does anybody have an explanation? I know the table users is correct and I know all the inputtypes are INT. I try to make an inventory database with inventory_id as PK, user_id and product_id as FKs and inventory_amount (All specified as INT ofcourse)
When I remove the user_id and only keep product_id as FK everything works fine but not as it should. Tips would be appreciated.

Options: ReplyQuote


Subject
Views
Written By
Posted
InnoDB error with FKs
1268
November 27, 2012 09:29AM
577
November 28, 2012 08:42AM
744
November 28, 2012 10:07AM
609
November 28, 2012 11:02AM
715
November 28, 2012 11:22AM


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.