Sign inSign up

nouvellemarque/mysql-tools

By nouvellemarque

•Updated over 6 years ago

MySQL utility tools

Image
2

681

nouvellemarque/mysql-tools repository overview

⁠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

Tag summary

Content type

Image

Digest

Size

130.3 MB

Last updated

over 6 years ago

docker pull nouvellemarque/mysql-tools