Backup a MySQL database from within a Docker container

Simple command to backup a MySQL database from within a Docker container

docker
MySQL
backups

Published 4 years ago

sudo docker exec -i <CONTAINER_ID> mysqldump -u <DATABASE_USERNAME> -p --databases <DATABASE_NAME> > yourbackup.sql