Linux

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 


Want me to help develop your next project or application?

Contact Us

Specializing in Ruby-on-Rails, Javascript, Multi-Platform Electron Desktop Apps and Hybrid Cordova Mobile Apps.

Recommended Posts