Run the following command:
mysqldump -u root -p databasename > backupfilename.sql
to backup a database.
To restore a database,
mysql -u root -p databasename < backupfilename.sql
will be the command to use.
You will be prompted for the password after running this command before any results are achieved.
This article has been provided by Codero Hosting, the leading provider of reliable dedicated, managed and cloud hosting services. Need more information on this topic or to learn more about Codero’s hosting services please visit www.codero.com, chat with us online or give us a call at 866-2-CODERO.