Skip to content

Rename a database in MySQL

Ever tried to rename a database in MySQL? Obviously not.

Why not? MySQL does not support renaming databases. Funny, eh?

They once tried to implement this feature but failed and removed the code again. Note the sudden major feature shifts in minor releases.

So, how to rename a database? Dump the database, create a new database and import the dump. Both steps can be executed together:

mysqldump old_database | mysql new_database


No Trackbacks


Display comments as Linear | Threaded

No comments

Add Comment

Enclosing asterisks marks text as bold (*word*), underscore are made via _word_.
E-Mail addresses will not be displayed and will only be used for E-Mail notifications.
To leave a comment you must approve it via e-mail, which will be sent to your address after submission.
Form options