snippetsqlMinor
How do you encrypt data while performing a mysqldump?
Viewed 0 times
performingwhileyoumysqldumphowencryptdata
Problem
My OS is windows 7.
Please help me.
Thanks
- How can I encrypt data while performing a mysqldump?
- From the command prompt, can I take a mysqldump with encrypted varchar and texts values?
Please help me.
Thanks
Solution
You can use
-
Creating the key file:
-
Encrypting the backup:
-
To decrypt the backup:
ccrypt. Example:-
Creating the key file:
echo 'mySecretKey123' > ~/.backup.key
chmod 600 ~/.backup.key-
Encrypting the backup:
mysqldump databasename | ccrypt -k ~/.backup.key | bzip -c > ~/backup-mysql.sql.bz2.cpt-
To decrypt the backup:
cat ~/backup-mysql.sql.bz2.cpt | ccat -k ~/.backup.key | bunzip2 -c | lessCode Snippets
echo 'mySecretKey123' > ~/.backup.key
chmod 600 ~/.backup.keymysqldump databasename | ccrypt -k ~/.backup.key | bzip -c > ~/backup-mysql.sql.bz2.cptcat ~/backup-mysql.sql.bz2.cpt | ccat -k ~/.backup.key | bunzip2 -c | lessContext
StackExchange Database Administrators Q#5831, answer score: 7
Revisions (0)
No revisions yet.