Skip to content

Instantly share code, notes, and snippets.

@healthy-tree
Last active July 12, 2023 02:52
Show Gist options
  • Save healthy-tree/1fffe7e3c8afa084a5e101bac870b0d0 to your computer and use it in GitHub Desktop.
Save healthy-tree/1fffe7e3c8afa084a5e101bac870b0d0 to your computer and use it in GitHub Desktop.
Docker Dump and restore MySQL All Databases
# backup
docker exec -it container mysqldump -u**** -p*** --all-databases > mysql_dump_yyyy_mm_dd.sql
# restore
cat backup.sql | docker exec -it container mysql -u**** -p**** --all-databases
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment