Docker MySQL and MariaDB Backup Script

With MySQL or MariaDB containers, you put the persistent database data on a Docker volume, but you still back up the database with mysqldump. This prevents the data you are backing up from being inconsistent, since you would have to make sure that no database operators are happening at the same time when you dump […]

En Lire Plus

How to backup data from docker-compose MariaDB container using mysqldump

For containers with a MYSQL_ROOT_PASSWORD stored in .env This is the recommended best practice. For this example, we will assume that .env looks like this: .env 📋 Copy to clipboard⇓ Download MARIADB_ROOT_PASSWORD=mophur3roh6eegiL8Eeto7goneeFei To create a dump: backup-data-from-docker-compose-mariadb-container-using-mysqldump.sh 📋 Copy to clipboard⇓ Download source .env && docker-compose exec mariadb mysqldump -uroot -p${MARIADB_ROOT_PASSWORD} –all-databases > mariadb-dump-$(date +%F_%H-%M-%S).sql To […]

En Lire Plus