Today we will talk how do you can easily rename a database in
MySQL.
At the MySQL version 5.1.7 was added a command to do this job
named RENAME DATABASE
RENAME {DATABASE | SCHEMA} db_name TO new_db_name;
But it was removed on the MySQL version 5.1.23 because maybe it would result in data lost’s like you can see on this link of MySQL documentation
Then, lets see some ways which we can do this:
1. Using the RENAME TABLE command
As long as two databases are on the same file system, you can use RENAME TABLE to move a table from one database to another:
RENAME TABLE current_db.tbl_name TO
other_db.tbl_name;
RENAME TABLE Syntax na Documentacao do MySQL
…[Read more]