How To Rename A MySQL Database From The Command Line

Posted by Weston Ganger

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:

Article Topic:Software Development - Linux

Date:December 23, 2015

Recommended Posts