To export a MySQL database, you need to use the mysqldump command. Here is the full command for exporting your database:
mysqldump -uUSERNAME -pPASSWORD DATABASE > backup.sql
To import a MySQl database, you need to use the mysql command. Here is the full command for importing a MySQL dump into a database:
mysql -uUSERNAME -pPASSWORD DATABASE < backup.sql