Bug #37074 Not possible to Rename the Database or make a copy of existing database.
Submitted: 29 May 2008 17:59 Modified: 31 May 2008 17:35
Reporter: Hema Sridharan Email Updates:
Status: Not a Bug Impact on me:
Category:MySQL Server: DDL Severity:S3 (Non-critical)
Version:mysql-6.0 OS:Any
Assigned to: CPU Architecture:Any

[29 May 2008 17:59] Hema Sridharan
1) There is no way by which user can Rename the database in current version 6.0.
2) There is no option to create copy of complete database as we have it for table eg: create table t2 like t1 ;
create table t2 as select * from t1;

It will be always good to have the redundant copy of same database with different name.

How to repeat:
RENAME DATABASE  db_name TO new_db_name;

mysql> rename database x to y;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'database x to y' at line 1
[31 May 2008 17:35] Sveta Smirnova
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://dev.mysql.com/doc/ and the instructions on
how to report a bug at http://bugs.mysql.com/how-to-report.php

As described at http://dev.mysql.com/doc/refman/5.1/en/rename-database.html: "This statement was added in MySQL 5.1.7 but was found to be dangerous and was removed in MySQL 5.1.23."