Skip to content

Instantly share code, notes, and snippets.

@joulgs
Last active February 8, 2023 17:18
Show Gist options
  • Save joulgs/40294211b52a71202d2acc0cd26df658 to your computer and use it in GitHub Desktop.
Save joulgs/40294211b52a71202d2acc0cd26df658 to your computer and use it in GitHub Desktop.
Backup DB in docker Conteiner
# Backup
docker exec CONTAINER_NAME /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restaurar
cat backup.sql | sudo docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@joulgs
Copy link
Author

joulgs commented Feb 8, 2023

mysql -u root -p banco_criado < backup.sql

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment