Quantcast
Viewing all articles
Browse latest Browse all 3724

InnoDB error with FKs (no replies)

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.

Viewing all articles
Browse latest Browse all 3724

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>