How to import MySQL database to the docker container

How to import MySQL database to the docker container

In this article, we are going to learn about how to import MySQL database to the docker container.

To have availability import MySQL database you should know the user and password of your MySQL docker container.
The command below shows you how to do import your local app.sql database dump file into the docker container where database name – app_db, user name – root and password – admin_pass

docker exec -i app_db mysql -uroot -padmin_pass app < app.sql

Leave a Reply

Your email address will not be published. Required fields are marked *