备份

bash
mysqldump -u user -p dbname > backup.sql

恢复

bash
mysql -u user -p dbname < backup.sql