Export a database which is called Test:
mysqldump -u <username> -p Test > Test.sql
The sql file will be generated after you input the password.
Import a database:
1. Create a new database called Test2
2. Import the Test.sql into the Test2
mysql -u root -p Test2 < Test.sql
The following picture shows the above steps in shell.

Reference: How to Back Up and Restore a MySQL Database

Good post.
the mysqldump is a great tool for MySQL backup
LikeLike
yes~ command line tools are simple and straight forward once you get familiar with them.
LikeLike