Skip to content

Instantly share code, notes, and snippets.

@stabastian
Last active April 2, 2020 19:45
Show Gist options
  • Save stabastian/f4967e78dfc11aeb1ae1f31596a62ec0 to your computer and use it in GitHub Desktop.
Save stabastian/f4967e78dfc11aeb1ae1f31596a62ec0 to your computer and use it in GitHub Desktop.
Docker MySql Dump
# Dump
docker run --rm -i mysql:TAG /usr/bin/mysqldump -uroot -proot --skip-comments DATABASE_NAME > dump_`date +%Y-%m-%d"_"%H-%M-%S`.sql
# Restore
cat dump.sql | docker run --rm -i mysql:TAG /usr/bin/mysql -uroot -proot DATABASE_NAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment