I am using MySQL 5.0.
I have created a database named "accounts", but now I want to change the database name to "FinanceAccounts".
How can I change the database name in MySQL 5.0?
I am using MySQL 5.0.
I have created a database named "accounts", but now I want to change the database name to "FinanceAccounts".
How can I change the database name in MySQL 5.0?
I think there is only one way (besides renaming directory in the MySQL datadir which will fail for InnoDB tables):
MySQL 5.1.7 to MySQL 5.1.22 had a RENAME {DATABASE | SCHEMA} db_name TO new_db_name;
command but this one has been removed in MySQL 5.1.23 for being too dangerous.
The best way is probably to rename each of the tables inside the database to the new name. For example:
RENAME TABLE accounts.tablename TO newaccounts.tablename;
See http://dev.mysql.com/doc/refman/5.0/en/rename-table.html for more information.