The blog about containerisation, virtual machines and useful shell snippets and findings

Simple docker mysql backup/restore

https://gist.github.com/spalladino/6d981f7b33f6e0afe6bb

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