Answer the question
In order to leave comments, you need to log in
How to make a copy of the database spinning in the docker (the storage itself on volume) using xtrabackup?
xtrabackup on the host
, it needs access to /var/run/mysqld/mysqld.sock
in the MariaDB container to copy the database Run
like this:
docker run --name 10.1.23-mariadb -p 3308:3306 -v /opt/test/mariadb:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=password -d mariadb:10.1.23
Answer the question
In order to leave comments, you need to log in
In short like this:
and get a direct path to the
socket this is only for the test, and if there is such a configuration in real life - my.cnf can be generated by a script
https://github.com/martin-helmich/docker-xtrabackup
may help
, but in general you can mount exactly /var/run/mysqld/mysqld.sock, but this file must already be before the container is started.
Don't mix containers with host processes.
Mount the directory for backups in advance, run xtrabackup from the container.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question