简体   繁体   中英

can't create a table without foreign key errno:150 MYSQL

我有一个具有外键约束的表“供应商”,删除了它,现在我想重新创建一个完全没有外键的表,但是我遇到的经典错误是150,任何想法都可以做。 -创建此表。

In the file that the SQL is dumped in and that you are loading to recreate the database, add SET FOREIGN_KEY_CHECKS = 0 ; at the start and SET FOREIGN_KEY_CHECKS = 1 at the end

It seems that there is an inconsistency there, as creating a table without constraints should be possible at any time. From the Mysql Manual , what you should do is run

SHOW ENGINE INNODB STATUS.

or

SHOW ERRORS

to check the detail of the error you are getting.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM