Backup and restore dump of MySQL database

How to create a dump file of a MySQL database with mysqldump command and restore.

Used
MySQL version 5.5.1.4
 
A simple way to copy or backup MySQL database is the use of mysqldump command in the command line.
 
mysqldump -u [user] -p --all-databases > [directory\filename].sql
 
to restore the database dump use the following:
 
mysql -u [user] -p < [directory\filename].sql
 
-u
-p
--all-databases
username
password
all databases, or use a specific database name