SQL 外键约束错误 1025 (152)
每次我尝试删除名为“countires”的表和名为“countries”的字段时,我都会收到错误。
#1025 - Error on rename of '.\mutli_page_form\survey'
to '.\mutli_page_form\#sql2-820-1fb' (errno: 152)
它说对表“调查”有 FK 依赖性,我多次尝试删除它但没有成功。
#1217 - Cannot delete or update a parent row: a foreign key constraint fails
我现在在尝试删除国家/地区表时收到此错误
I keep getting an error every time i try to drop a table called "countires" and a field called "countries".
#1025 - Error on rename of '.\mutli_page_form\survey'
to '.\mutli_page_form\#sql2-820-1fb' (errno: 152)
It says there is a FK dependency on the table "survey" i have tried multiple times to delete it to no success.
#1217 - Cannot delete or update a parent row: a foreign key constraint fails
I now get this error once trying to delete the table of Countries
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
数据库已被告知要确保数据完整性。这就是你所看到的。有引用某个国家/地区的调查数据。如果您删除国家/地区表,则调查数据将没有与其关联的有效国家/地区。您必须先删除调查,然后才能删除国家/地区。
The database has been told to ensure data integrity. This is what you're seeing. There is survey data that references a country. If you delete the country table then the survey data won't have valid countries associated with it. You'll have to remove the surveys first before you can remove the countries.
您必须为 2 个表中的 id () 设置索引 ->重试后
You must set index both for id ()'s in 2 tables -> after try again