Mysql

How To Rename A MySQL Database From The Command Line

Posted by Weston Ganger on December 23, 2015

Its pretty easy to rename a MySQL database from the command line.


# Create New Database
mysqladmin -u username -p create new_database

# Copy Database Contents
mysqldump -u username -v -p old_database | mysql -u username -p -D new_database

# Then Delete the Old Database
mysqladmin -u username -p drop old_database


Related External Links:


Posted in Linux and Tagged with mysql linux 


Need help on your next project or application?

I specialize in Ruby-on-Rails, AngularJS, Javascript, Bootstrap, and Hybrid Mobile Apps with Cordova & Ionic.

Contact Me

Recommended Posts