MySQL Creating tables with Foreign Keys giving errno: 150

前端 未结 20 2357
深忆病人
深忆病人 2020-11-21 05:02

I am trying to create a table in MySQL with two foreign keys, which reference the primary keys in 2 other tables, but I am getting an errno: 150 error and it will not create

20条回答
  •  不知归路
    2020-11-21 05:18

    MySQL Workbench 6.3 for Mac OS.

    Problem: errno 150 on table X when trying to do Forward Engineering on a DB diagram, 20 out of 21 succeeded, 1 failed. If FKs on table X were deleted, the error moved to a different table that wasn't failing before.

    Changed all tables engine to myISAM and it worked just fine.

提交回复
热议问题