mysqldump -u user -p database_name > dumpfilename.sql
The above command should ask you for your password once you hit enter, it'll then dump the database databasename to the file dumpfilename.sql
You can then tar the file so it's compressed; since it's just text it compresses really well, so run:
tar -cvzf archive.tgz dumpfilename.sql