“Rename” database name in MySQL
April 28, 2007 on 11:01 am | In MySQL |Currently, there is no method to rename database name in MySQL, but you could easily use mysqldump command backup your database and then read it back in to a new database.
Step 1 Dump the database structure and content:
mysqldump -u username -p dbname >> dump.sql
Step 2 Create a new empty database.
mysql -u username -p dbname
mysql> create database newdbname;
Step 3 Reload the database into a new database with a different name:
mysql -u username -p newdbname < dump.sql
No Comments yet »
RSS feed for comments on this post. TrackBack URI
Leave a comment
Powered by WordPress with Pool theme design by Borja Fernandez.
Entries and comments feeds.
Valid XHTML and CSS. ^Top^