Home  >  Q&A  >  body text

mysql无法添加外键

高洛峰高洛峰2719 days ago478

reply all(1)I'll reply

  • 大家讲道理

    大家讲道理2017-04-17 15:52:10

    If you recreate a dropped table, it must have a definition that conforms to the foreign key constraints that reference it. It must have the correct column names and types, and there must be an index on the referenced key, as mentioned earlier. 如果这些不满足,MySQL返回错误1005并引用错误消息中的错误150,这意味着外键约束没有正确形成。 Similarly, if ALTER TABLE fails with error 150, it means that the foreign key definition will not be formed correctly for the changed table.

    http://stackoverflow.com/ques...

    reply
    0
  • Cancelreply