docker-lamp icon indicating copy to clipboard operation
docker-lamp copied to clipboard

Question. How is suppose to be use?

Open juan-morales opened this issue 4 years ago • 3 comments

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?

juan-morales avatar Jun 02 '21 18:06 juan-morales

Try to import it with phpmyadmin or entering on the sql shell

adrianpisabarrogarcia avatar Jun 14 '21 23:06 adrianpisabarrogarcia

I don't understand your question "what about the db" ? docker-compose up will import the db.

jcavat avatar Jun 15 '21 06:06 jcavat

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.

pliski avatar Jun 19 '21 20:06 pliski