Skip to content

Instantly share code, notes, and snippets.

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
Copy link

tomaszroot commented Aug 31, 2022


Copy link

botosdavid commented Sep 19, 2022

thank you so much!

Copy link

dorimusz commented Sep 19, 2022

Thanks a lot!

Copy link

ttcosta11 commented Sep 26, 2022

Thank you!

Copy link

tgiovanella87 commented Oct 12, 2022

Great! Thanks!

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