Skip to content

Instantly share code, notes, and snippets.

@masb0ymas
Created March 10, 2023 02:15
Show Gist options
  • Select an option

  • Save masb0ymas/789730f505e8e81ab27aab1e6fea1241 to your computer and use it in GitHub Desktop.

Select an option

Save masb0ymas/789730f505e8e81ab27aab1e6fea1241 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 backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment