如何重命名 MySQL 架构?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4545634/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 18:07:31  来源:igfitidea点击:

How do I rename a MySQL schema?

mysqldatabaserenamemysql-workbench

提问by snakile

Possible Duplicate:
how does one rename a schema in MySQL

可能的重复:
如何在 MySQL 中重命名架构

Is there a MySQL statement for renaming a schema? I know about RENAME {DATABASE | SCHEMA} db_name TO new_db_name;, but that statement "was found to be dangerous and was removed in MySQL 5.1.23" (as they mention in here).

是否有用于重命名架构的 MySQL 语句?我知道RENAME {DATABASE | SCHEMA} db_name TO new_db_name;,但该语句“被发​​现是危险的,并在 MySQL 5.1.23 中被删除”(正如他们在此处提到的)。

I was also trying to do it using MySQL Workbench. I tried right clicking on the schema, and then alter schema. But they don't let you change its name in there.

我也尝试使用 MySQL Workbench 来做到这一点。我尝试右键单击架构,然后更改架构。但是他们不允许你在那里更改它的名字。

So how do people rename databases?

那么人们如何重命名数据库呢?

回答by Sondre

If you're on the Model Overview page you get a tab with the schema. If you rightclick on that tab you get an option to "edit schema". From there you can rename the schema by adding a new name, then click outside the field. This goes for MySQL Workbench 5.2.30 CE

如果您在模型概览页面上,您会看到一个包含架构的选项卡。如果您右键单击该选项卡,您将获得“编辑架构”的选项。从那里您可以通过添加新名称来重命名架构,然后在字段外单击。这适用于 MySQL Workbench 5.2.30 CE

Edit: On the model overview it's under Physical Schemata

编辑:在模型概述中,它位于 Physical Schemata 下

Screenshot:

截屏:

enter image description here

在此处输入图片说明