Foreign key issue:ERROR 1005 (HY000): Can't create table (errno: 150)

后端 未结 2 1103
难免孤独
难免孤独 2021-01-26 10:49

I\'m getting this error: ERROR 1005 (HY000): Can\'t create table (errno: 150); I know it has something to do with the foreign keys but I have checked to see if they

2条回答
  •  终归单人心
    2021-01-26 10:59

    Solved:

    Check to make sure Primary_Key and Foreign_Key are exact match with data types.
    
    If one is signed another one unsigned, it will be failed.
    Good practice is to make sure both are unsigned INT.
    

提交回复
热议问题