MySQL “ERROR 1005 (HY000): Can't create table 'foo.#sql-12c_4' (errno: 150)”

后端 未结 14 840
情深已故
情深已故 2020-12-03 04:13

I was working on creating some tables in database foo, but every time I end up with errno 150 regarding the foreign key. Firstly, here\'s my code for creating t

14条回答
  •  一个人的身影
    2020-12-03 04:43

    Note: I had the same problem, and it was because the referenced field was in a different collation in the 2 different tables (they had exact same type).

    Make sure all your referenced fields have the same type AND the same collation!

提交回复
热议问题