docker-lamp
docker-lamp copied to clipboard
Question. How is suppose to be use?
I Know that with docker-compose up... I spin up Everything.
But what About the DB? I Know I Can't manually import it... But is there any automatic mechanism that will import the dump?
Try to import it with phpmyadmin or entering on the sql shell
I don't understand your question "what about the db" ? docker-compose up will import the db.
Maybe the op question was about executing again the sql in the dump directory on successives docker-compose up.
Unfortunately this is not how it is meant to work. You can see the first answer to this question for more info: https://stackoverflow.com/questions/38504257/mysql-scripts-in-docker-entrypoint-initdb-are-not-executed/52715521
As a quick and dirty workaround I installed /var/lib/mysql locally, in order to be able to easily delete all the content and force the install script to reload the sql.
Here are the changes in the docker-compose.yml:
From:
volumes:
....
- persistent:/var/lib/mysql
to:
volumes:
....
- ./mysql_data:/var/lib/mysql
But, as the op stated, an easiest way is to re-import the sql in phpmyadmin or from mysql shell.