Home Products QA Support Contact

Rename a schema/database in Mysql

There's no direct and easy way to do it. The easiest thing to do is to dump and restore the database in a different schema. Something like:

mysqldump -u username -p -v olddb > olddb.sql
mysqladmin -u username -p create newdb
mysql -u username -p newdb < olddb.sql

You can also use gui tools to do this.