Skip to content

Instantly share code, notes, and snippets.

@andyg1
Created April 25, 2023 10:22
Show Gist options
  • Save andyg1/ad378288846dfc9bff673db018e5afa2 to your computer and use it in GitHub Desktop.
Save andyg1/ad378288846dfc9bff673db018e5afa2 to your computer and use it in GitHub Desktop.
Import a sql dump into a mysql docker container
# 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