Backup using mysqldump:
*Restoring a backup of a database or table
mysql [options] db_name < filename.sql
Note that:
db_name needs to be an existing database;
filename.sql;
.sql is fully a matter of style. Any extension would work.
filename.sql.
Alternatively, when in the MySQL Command line tool, you can restore (or run any other script) by using the source command:
source filename.sql
or
\. filename.sql