Docker container back up and restoration

December 5th, 2017

# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql

# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE

not specifically docker, but in mysql:
mysql -u mysqlusername -p databasename < blog.sql


Leave a Reply

Your email address will not be published. Required fields are marked *