dima7b
12/22/2015 - 1:47 PM

Backup and restore a mysql database from a running Docker mysql container

Backup and restore a mysql database from a running Docker mysql container

# 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