Dumping and Restoring Databases
So far we created our databases and tables step by step. We used the mysql command shell to type in the statements. Whenever we had to start from scratch again, we had to type in all the statements again. Fortunately, there is a way of dumping a complete database and to restore such a dumped database again. Dumping a database is also a convenient way to backup and to port databases.Dump a Database
A database is dumped offline (e.g. on a Bash command line) with the mysqldump command:mysqldump -u root musicarchive -p > musicarchive.sql
Restore a Database
Restoring the database can be done offline as well:mysql -u root -p musicarchive < musicarchive.sql