Encryption of mysqldump file using Openssl

8:44 PM

Using Openssl the mysqldump file can be encrypted before its saved onto the disk.
The following steps show how this can be used:
1) Start with backing up databases using mysqldump
mysqldump -uopsbackup --password=<opsbackup-password> --single-transaction --opt  --all-databases > all-databases.sql
2) Encrypt the backup file and add the password(<secret-pin>) to it so that once this password can decrypt the file
openssl enc -aes-256-cbc -salt -in all-databases.sql -out all-databases.sql.enc -pass pass:<secret-pin>
3) To load back, file need to be decrypted into readable format. To Decrypt run
openssl aes-256-cbc -d -in all-databases.sql.enc -out all-databases.sql.enc -k <secret-pin>
4) Now can can load the databases. To load run
mysql -uroot -p <  all-databases.sql

You Might Also Like

0 comments

Contact Form

Name

Email *

Message *

Translate

Wikipedia

Search results