How to rename a MySQL InnoDB-based database
by pompo500 on Feb.07, 2011, under Uncategorized
Sadly (at least the current version) MySQL does not support “rename database” clause anymore, because it’s “unsafe”.
Here’s how to do it manually:
Issue
create database “newdatabase”;
Then for every table in your old database
rename table `olddatabase`.`tablename` to `newdatabase`.`tablename`;
Yeah I know it’s manual labor, but “show tables” query and a text editor with macro support makes it a bit easier. :)