“添加删除表/视图/过程/功能”是什么意思? phpmyadmin 中的复选框
在“结构”选项卡下,当使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
创建表、视图、过程或函数时,会在其前面添加 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 theDROP
checkbox, it will attempt to create theusers
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.
我对这个说法的确切含义感到困惑,所以我对这个主题进行了额外的研究,并想在这里留下详细的解释以供将来参考。
上面引用中的创建和删除操作只是导入已导出的文件时的说明。我最初的印象是这些行为是在我导出时发生的。事实并非如此。它只是有关何时导入导出的文件的说明。
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.