Export A MySQL Database
1. Using SSH, execute the following command:
2. mysqldump -u username -p database_name > dbname.sql
3. You will be prompted for a password, type in the password for the username and press Enter. Replace username, password and database_name with your MySQL username, password and database name.
File dbname.sql now holds a backup of your database and is ready for download to your computer.