How do you encrypt data while performing a mysqldump?
You can use ccrypt. Example:


Creating the key file:

echo 'mySecretKey123' &gt; ~/.backup.key
chmod 600 ~/.backup.key

Encrypting the backup:

mysqldump databasename | ccrypt -k ~/.backup.key | bzip -c &gt; ~/backup-mysql.sql.bz2.cpt

To decrypt the backup:

cat ~/backup-mysql.sql.bz2.cpt | ccat -k ~/.backup.key | bunzip2 -c | less