Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 19257

Docker images, containers, hub, and everything related to the containerization platform

0 votes
2 answers
1k views

backup dockerise mysql database from host volume

For a "new project", we use now docker servers and one with a mysql 5.7 and a volume to save this new project database in a host folder, for exemple: /path/on/host/dockerise/db/ I want to backup too this …
bcag2's user avatar
  • 111
1 vote
Accepted

backup dockerise mysql database from host volume

based on @ulrich answer, but with mysqldump : DATE_TIME=`date +"%Y%m%d_%H%M" CONTAINER_NAME="mysql_server" CONTAINER=`docker ps -q -f name=${CONTAINER_NAME}` PASSWORD=`docker exec ${CONTAINER} sh -c 'echo … $MYSQL_ROOT_PASSWORD'` BACKUP_FILE=${DATE_TIME}_${CONTAINER_NAME}.backup.sql.gz CONTAINER_BACKUP_DIR="/var/lib/mysql/" HOST_DATA_DIR="/path/on/my/VM/correspond/to/docker/volume/" HOST_BACKUP_DIR="/other …
bcag2's user avatar
  • 111