/ tech-note

How to rename a database in MySQL?

Take the following steps:

mysqldump -uUSERNAME -p DBNAME > FILENAME.sql
mysql -uUSERNAME -p -e "create database NEW_DBNAME;"
mysql -uUSERNAME -p NEW_DBNAME < FILENAME.sql