Backup and restore dump of MySQL database

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

MySQL version
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
all databases, or use a specific database name