Skip to content

Instantly share code, notes, and snippets.

@vladzadvorny
Created July 11, 2017 13:10
Show Gist options
  • Save vladzadvorny/44d3e03b210c8735c1695b10d332713f to your computer and use it in GitHub Desktop.
Save vladzadvorny/44d3e03b210c8735c1695b10d332713f to your computer and use it in GitHub Desktop.
# Get
docker pull mariadb:latest
# Run
run --name mariadbtest -p 127.0.0.1:3305:3306 -e MYSQL_ROOT_PASSWORD=mypass -d mariadb
# 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