MySQL. Can't create table errno 150

前端 未结 22 1389
广开言路
广开言路 2020-12-01 09:59

I have to create a database with two tables in MySQL, but the script fails with errno 150 (foreign key problem). I double-checked the foreign key fields to be the same on bo

22条回答
  •  被撕碎了的回忆
    2020-12-01 10:34

    Another hint:

    Even when your data types seem to be the same - in my case both columns had VARCHAR(50) - this is not enough.

    You also need to make sure that both columns have the same COLLATION.

提交回复
热议问题