docker run --rm \
--link mysql_server:mysqlserver \
-v /path/to/backup/path:/data \
-e MYSQL_DB_USER=root \
-e MYSQL_DB_PASS=secret \
-e MYSQL_DB_NAME=mydatabase \
-e DUMP_SUFFIX=production \
-e DUMP_EXPLODED=true \
nouvellemarque/mysql-tools dump
mysql_server - the mysql docker container/path/to/backup/path - the path on your host where the backup would be storedDUMP_SUFFIX - suffix for each fileDUMP_EXPLODED - dump all tables into separate filesdocker run --rm \
--link mysql_server:mysqlserver \
-v /path/to/backup/path:/data \
-e DUMP_FILE=dumpfile.tar.gz \
-e MYSQL_DB_USER=root \
-e MYSQL_DB_PASS=secret \
nouvellemarque/mysql-tools restore
mysql_server - the mysql docker containerSOURCE - the filename of the dump to restore/path/to/backup/path - the path on your host where the backup is storeddocker run --rm \
--link mysql_server:mysqlserver \
-v /path/to/backup/path:/data \
-e DUMP_FILE=dumpfile.tar.gz \
-e DUMP_DB_SOURCE=mydatabase \
-e DUMP_DB_TARGET=mynewdatabase \
-e MYSQL_DB_USER=root \
-e MYSQL_DB_PASS=secret \
nouvellemarque/mysql-tools restore
DUMP_DB_SOURCE - the name of the database contained in the backup fileDUMP_DB_TARGET - the name of the database to restoreContent type
Image
Digest
Size
130.3 MB
Last updated
over 6 years ago
docker pull nouvellemarque/mysql-tools