Friday, July 15, 2011

MYSQL: Change mysql db schema name

How to change mysql database schema name?

Here s what you need to do:
1. Use mysqldump to dump old mysql database.
2. Create new database using mysqladmin.
3. And run the sql generated via mysqldump.

e.g. if you want to change database named "school_old" to "school_new"
Here are the commands.
mysqldump -u username -p -v school_old > old_db_dump.sql
mysqladmin -u username -p create school_new
mysql -u username -p school_new < old_db_dump.sql

Labels: , , ,

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home