Skip to content

Instantly share code, notes, and snippets.

View hounded's full-sized avatar

James Whiteman hounded

View GitHub Profile
@hounded
hounded / mysql-docker.sh
Last active November 9, 2017 03:08 — forked from spalladino/mysql-docker.sh
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 linux
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
# Restore powershell
type backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE