Sign inSign up

sinso/mariadb

By sinso

•Updated over 8 years ago

Image
0

1.4K

sinso/mariadb repository overview

⁠Docker MariaDB

⁠DB export

You can create database dumps with the db_dump command. There are no credentials necessary to run this command. And you can add custom parameters (e.g. --no-data)

  • Output dump on STDOUT

    docker exec <DOCKER-CONTAINER-NAME> db_dump
    
  • Output dump on STDOUT (with custom parameters)

    docker exec <DOCKER-CONTAINER-NAME> db_dump --no-data
    
  • Save dump in file

    docker exec <DOCKER-CONTAINER-NAME> db_dump > `date +%Y%m%d`.sql
    
  • Save dump in compressed file

    docker exec <DOCKER-CONTAINER-NAME> db_dump | gzip -9 > `date +%Y%m%d`.sql.gz
    
  • Execute a fast dump (nice and without locking tables). There's the risk to get a inconsistent dump.

    docker exec <DOCKER-CONTAINER-NAME> db_fast_dump
    

⁠DB import

To import a database use the following commands

  • Import from a sql-file

    docker exec -i <DOCKER-CONTAINER-NAME> db_import < dump.sql
    
  • Import from another db container

    docker exec <SOURCE-DOCKER-CONTAINER-NAME> db_dump | docker exec -i <TARGET-DOCKER-CONTAINER-NAME> db_import
    
  • ... or even piped through ssh to a remote server

` docker exec db_dump | ssh user@server "docker exec -i db_import"

Tag summary

Content type

Image

Digest

sha256:bbee9dd42…

Size

114 MB

Last updated

over 8 years ago

docker pull sinso/mariadb