“添加删除表/视图/过程/功能”是什么意思? phpmyadmin 中的复选框

发布于 2024-08-31 04:00:17 字数 104 浏览 1 评论 0原文

在“结构”选项卡下,当使用 phpmyadmin 导出数据库时,会有一个复选框,标记为:
添加删除表/视图/过程/函数 这是做什么的?

Under the structure tab, when EXPORTing a database using phpmyadmin there is a check box labeled:
Add DROP TABLE / VIEW / PROCEDURE / FUNCTION
What does this do?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

淡墨 2024-09-07 04:00:17

创建表、视图、过程或函数时,会在其前面添加 DROP 语句。这样做的结果是,即使该项目存在,它仍然会被创建。

例如:如果您有一个名为 users 的表,并且您在没有选择 DROP 复选框的情况下运行导出脚本,它将尝试创建 users 表再次但会失败,因为它已经存在。如果选中它,它将在创建表之前删除该表(如果存在),以确保创建始终成功。

当然,如果您不想丢失表中的数据,这可能会很危险。

When creating a table, view, procedure, or function, it will add a DROP statement before it. The result of this is that even if the item exists, it will still be created.

For example: If you have a table called users and you run the export script without the DROP checkbox, it will attempt to create the users table again but will fail since it already exists. If you check it, it will drop the table before it is created (if it exists) to ensure the creation will always be successful.

Of course this can be dangerous if you have data in the table that you don't want to lose.

友欢 2024-09-07 04:00:17

例如:如果您有一个名为 users 的表,并且在没有 DROP 复选框的情况下运行导出脚本,它将尝试再次创建 users 表,但会失败,因为它已经存在。如果选中它,它将在创建之前删除该表(如果存在),以确保创建始终成功。

我对这个说法的确切含义感到困惑,所以我对这个主题进行了额外的研究,并想在这里留下详细的解释以供将来参考。

上面引用中的创建和删除操作只是导入已导出的文件时的说明。我最初的印象是这些行为是在我导出时发生的。事实并非如此。它只是有关何时导入导出的文件的说明。

For example: If you have a table called users and you run the export script without the DROP checkbox, it will attempt to create the users table again but will fail since it already exists. If you check it, it will drop the table before it is created (if it exists) to ensure the creation will always be successful.

I was confused as to what this statement meant exactly, so I did additional research on the topic and wanted to leave an elaborated explanation here for future reference.

The create and drop actions in the above quote are simply instructions for when you import the file you have already exported. I was initially under the impression that these actions were happening as I was exporting. This is not the case. It's simply instructions for when you import your exported file.

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