Last active
April 17, 2018 15:50
-
-
Save ajardin/1ae66d888c7cc6bfe95ded2058a9e7ac to your computer and use it in GitHub Desktop.
Use MySQL data directly from a Docker volume.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Extract MySQL data | |
docker run --rm --volumes-from XXXXX -v $(pwd):/backup busybox sh -c "tar cvf /backup/backup.tar /var/lib/mysql" | |
# Restore MySQL data | |
docker run --rm --volumes-from XXXXX -v $(pwd):/backup busybox sh -c "tar xvf /backup/backup.tar var/lib/mysql/" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment