These commands will backup and restore backups of a complete database to the current directory you're in. The -p option will prompt you for the DB's password (which you can get from wp-config.php)

mysqldump your_db_name -u your_db_username -p > backup_filename_to_create.sql
mysql your_db_name -h localhost -u your_db_username -p < backup_filename_to_restore.sql

Often the values for "your_db_name" and "your_db_username" are the same values. Let me know if you have any questions.