Anonymous
×
Create a new article
Write your page title here:
We currently have 27 articles on PhenixOps. Type your article name above or click on one of the titles below and start writing!



PhenixOps
27Articles

Backup MySql databases and encrypt them

Make a backup

mysqldump -u root -p databasename > /path/to/mysql/database.sql

Encrypt (This will ask for a password when invoked)

openssl enc -aes-256-cbc -in /path/to/mysql/database.sql -out /backups/enc-database.sql

Decrypt (Provide the password you used to encrypt

openssl enc -aes-256-cbc -d -in /backups/enc-database.sql > /path/to/mysql/database.sql

Restore the backup

mysql -u root -p databasename < /path/to/mysql/database.sql