且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

删除索引时出现MySQL错误(errno 150)

更新时间:2021-11-08 00:26:57

根据

According to this link, the error relates to the definition of the primary key field. The error isn't about the foreign key index.

检查COMMENTS表的主键,以确保它没有UNSIGNED关键字,而COMMENTS.id_user外键具有UNSIGNED关键字.此关键字引起了问题-字段类型不一致.

Check the primary key for the COMMENTS table to make sure it does not have the UNSIGNED keyword while the COMMENTS.id_user foreign key had the UNSIGNED keyword. This keyword was causing the problem - inconsistent type of field.

要修复,请将UNSIGNED关键字添加到COMMENTS表的主键定义中.或从外键定义中删除UNSIGNED关键字...

To fix, add the UNSIGNED keyword to the primary key definition for the COMMENTS table. Or remove the UNSIGNED keyword from the foreign key definition...