Save (and restore) a MySQL data base
This recipe explain how to make a backup of a complete database in a easy way. Then, the backup file can be restored when a disaster occurs.
Make a backup
The required command is
mysqldump that has the next syntax:
mysqldump -u [user] -p [dbname] > [backup.sql]
Restore de database from a file
This is the same method to load a .sql file: