How do I rename a MySQL schema? [duplicate]

2019-02-07 20:11发布

问题:

Possible Duplicate:
how does one rename a schema in 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).

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.

So how do people rename databases?

回答1:

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

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

Screenshot: