Created
April 25, 2023 10:22
-
-
Save andyg1/ad378288846dfc9bff673db018e5afa2 to your computer and use it in GitHub Desktop.
Import a sql dump into a mysql docker container
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# from the host terminal | |
# find the container id | |
$ docker ps | |
# copy the file | |
$ docker cp /path/to/file.sql <CONTAINTER_ID>:/file.sql | |
# in the terminal for the container (e.g. via Docker Desktop) | |
$ mysql -u root -p | |
mysql> use <DATABASE_NAME>; | |
mysql> source file.sql; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment