Skip to content

Instantly share code, notes, and snippets.

@constrict0r
Created December 2, 2019 16:29
Show Gist options
  • Save constrict0r/bfe74d897c2d6f9491dbd255ae998f23 to your computer and use it in GitHub Desktop.
Save constrict0r/bfe74d897c2d6f9491dbd255ae998f23 to your computer and use it in GitHub Desktop.
Mariadb Backup/Restore with Docker
# Backup - from the host machine run:
docker exec CONTAINER mysqldump -u root --password=PASS DATABASE > CONTAINER.sql
# Restore - from the host machine run:
cat CONTAINER.sql | docker exec -i CONTAINER mysql -u root --password=PASS DATABASE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment