Using mysqldump, assuming you want to dump all databases...
local computer
/path/to/mysql/bin/mysqldump --all-databases -h $HOSTNAME -u $USERNAME -p$PASSWORD > backup.sql
This dumps all databases into a text file called backup.sql
On the remote computer, you should be able to issue the same command, only using a < instead of a >. This tells it to load the file into the database, instead of the database into the file....
If you lookup mysqldump in to the manual, you'll see that there's a ton of options to pass to it, so you can customize the command to fit your needs.