How do I rename a MySQL schema?

snakile picture snakile · Dec 28, 2010 · Viewed 101.3k times · Source

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?

Answer

Sondre picture Sondre · Dec 28, 2010

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:

enter image description here