How to import MySQL database to the docker container

In this article, we will learn 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 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