Backing up a database using mysqldump:

mysqldump -u [username] [dbname] > [dump_filename]

Restoring database from a backup:

mysql -u [username] [dbname] < [dump_filename]

References