Big databases are always a problem and it is handy to clean up your database before you are going to do a db dump. This is most handy when you have to move the dump from one server to another.
The syntax for you file will be something like this
Then you want to save this as a sql file. (cleandb.sql)
Then you can run it against your current database (After you make a backup) like this:
First I would take a current backup of your database like this
mysqldump -p'password' -u user -h hostaddress databasename | gzip > backup.sql.gz
Then run the clean script
mysql -p'password' -u user -h hostaddress databasename < cleandb.sql