Skip to content

Instantly share code, notes, and snippets.

@lurepheonix
Created May 6, 2022 10:17
Show Gist options
  • Save lurepheonix/e2e7e73a11ba1f35aac435719756ccfa to your computer and use it in GitHub Desktop.
Save lurepheonix/e2e7e73a11ba1f35aac435719756ccfa to your computer and use it in GitHub Desktop.
# backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# restore
cat DATABASE_SQL | pv | docker exec -i CONTAINER /usr/bin/mysql -u MYSQL_USER --password=MYSQL_PASSWORD DATABASE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment