Public | Automated Build

Last pushed: 9 months ago
Short Description
MySQL utility tools
Full Description

MySQL Tools Docker image

Usage

Backup

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 stored
  • DUMP_SUFFIX - suffix for each file
  • DUMP_EXPLODED - dump all tables into separate files

Restore

docker 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 container
  • SOURCE - the filename of the dump to restore
  • /path/to/backup/path - the path on your host where the backup is stored

Restore to target database

docker 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 file
  • DUMP_DB_TARGET - the name of the database to restore
Docker Pull Command
Owner
nouvellemarque
Source Repository

Comments (0)