MySQL Database – Backup and Restoration
Command to create the database backup.
mysqldump -u [database_user] -p [database_name] > dumpfilename.sql
Command to restore the database backup.
mysql -u [database_user] -p [database_name] < database.sql
(Use 'mysqldump --opt --all-databases > all_backup.sql' to backup everything.)
(Use the parameters '-h [IP address]' to access a database remotely.)
Click here for more info on mysqldump.