Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Backup and restore a mysql database from a running Docker mysql container
# 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
@tomaszroot
Copy link

tomaszroot commented Aug 31, 2022

:-*

@botosdavid
Copy link

botosdavid commented Sep 19, 2022

thank you so much!

@dorimusz
Copy link

dorimusz commented Sep 19, 2022

Thanks a lot!

@ttcosta11
Copy link

ttcosta11 commented Sep 26, 2022

Thank you!

@tgiovanella87
Copy link

tgiovanella87 commented Oct 12, 2022

Great! Thanks!

@paulovnas
Copy link

paulovnas commented Nov 4, 2022

Very nice... Thank you so much.

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