mysql error1215

来源:互联网 发布:windows如何录屏 编辑:程序博客网 时间:2024/06/03 21:09


You have a foreign key constraint operating in both directions. When you're creating the tables the first to be created will fail because the second doesn't exist. I'm not even sure that MySQL will accept a circular reference like this. You should probably remove the foreign key constraint applied to mydb.store

However, if this is essential you can ask MySQL to ignore the foreign key checks while you create the table. Just execute

SET foreign_key_checks = 0;

before you create the tables and

SET foreign_key_checks = 1;

after you finish

0 0
原创粉丝点击