How to dump a database using SSH?

If you have SSH enabled, you can export a database to your hosting account, using the following command, replacing the name, username, host and password with your database ones:

mysqldump DB_NAME -uDB_NAME -hMYSQL_HOST -pPASSWORD > /home/www/path-to/file.sql