Docker Community Forums

Share and learn in the Docker community.

How to import DB?

docker

(Muldy) #1

Hi!
Im start container https://hub.docker.com/r/janes/alpine-lamp/, all its Ok, but I dont know how to import DB.
I try command
docker exec -it ae23d0df030e mysql -uroot db < back.sql
And answer is:
the input device is not a TTY

How to import my db?


(Sam) #2

you need to get the data into the container…

so, the ‘easiest way’ is to use the -v or --volume docker run parameter to mount a host directory containing the backup file into the container, so that when you restore executes it can find the data.