If you're on a Linux/Unix machine, you can use the Command Line tools via SSH to create a database dump (backup of the mysql database) by inserting the command:
mysqldump -uusername -ppassword databasename > databasename.sql
If you wish to compress the above output so that it's easier to transfer around, then you can do:
tar -cvpzf databasename.tgz databasename.sql
If you've compressed the output and would like to decompress it, then you can run:
tar -xzvf databasename.tgz
(the output will extract as
databasename/
databasename.sql)
And to restore said backup, after you purge data out of the MySQL database:
mysql -h localhost -uusername -ppassword databasename < databasename.sql