Answer the question
In order to leave comments, you need to log in
How to run mysql in a docker container with data from the host?
I downloaded the image from https://hub.docker.com/_/mysql/ .
I already have mysql on the host. The versions on the host and in the image are the same. I want to run in mysql container with data from host.
I start the container like this:
sudo docker run --name my-mysql -v /var/lib/mysql:/var/lib/mysql -it mysql bash
Answer the question
In order to leave comments, you need to log in
Do you want two MySQL servers to read the same table files?
So that two servers simultaneously overwrite each other's data?
So that two servers climb into the same files with different meta-data?
Some kind of nonsense turns out ....
If you need a copy of all tables / data / users, then set up replication between your host and the docker container.
Perhaps you need to get from the application in the docker container to the DBMS on the host?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question