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

后端 未结 14 831
情深已故
情深已故 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:46

    all, I solved a problem and wanted to share it:

    I had this error <> The issue was in that in my statement:

    alter table system_registro_de_modificacion add foreign key (usuariomodificador_id) REFERENCES Usuario(id) On delete restrict;

    I had incorrectly written the CASING: it works in Windows WAMP, but in Linux MySQL it is more strict with the CASING, so writting "Usuario" instead of "usuario" (exact casing), generated the error, and was corrected simply changing the casing.

提交回复
热议问题