SQL 外键约束错误 1025 (152)

发布于 2024-10-24 18:00:27 字数 358 浏览 3 评论 0原文

每次我尝试删除名为“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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

初见终念 2024-10-31 18:00:27

数据库已被告知要确保数据完整性。这就是你所看到的。有引用某个国家/地区的调查数据。如果您删除国家/地区表,则调查数据将没有与其关联的有效国家/地区。您必须先删除调查,然后才能删除国家/地区。

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.

淡紫姑娘! 2024-10-31 18:00:27

您必须为 2 个表中的 id () 设置索引 ->重试后

You must set index both for id ()'s in 2 tables -> after try again

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文