$ mysqldump -u root -p -v old_db > old_db.sqlIf the database is the back end to a Rails app then you also need to update your config/database.yml file to use the new name and restart the web server, or nudge Passenger.
$ mysqladmin -u root -p create new_db
$ mysql -u root -p new_db < old_db.sql
Test out the new DB, test it again, and then some more before destroying the old database.
$ mysqladmin -u root -p drop old_db
No comments:
Post a Comment