Skip to content

Instantly share code, notes, and snippets.

@goodmuyis
Forked from spalladino/mysql-docker.sh
Created October 4, 2019 11:03
Show Gist options
  • Save goodmuyis/42d504eb9e58c7df6c74b9e79210470a to your computer and use it in GitHub Desktop.
Save goodmuyis/42d504eb9e58c7df6c74b9e79210470a to your computer and use it in GitHub Desktop.
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
@goodmuyis
Copy link
Author

goodmuyis commented Oct 4, 2019

# Backing up OnlyOffice Database Successfully

docker exec onlyoffice-mysql-server /usr/bin/mysqldump -u root --password=my-secret-pw onlyoffice > ~/pmc_oo_backup.sql && ls -a

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