Docker import (large) sql file

By.

min read

My profile

Share this:

run your mysql docker container

[code:1:cd532c38ee]docker ps[/code:1:cd532c38ee]

copy the mysql [b:cd532c38ee]ID[/b:cd532c38ee]

[code:1:cd532c38ee]docker inspect ID[/code:1:cd532c38ee]
Note the mount [b:cd532c38ee]source[/b:cd532c38ee]
Note the mount [b:cd532c38ee]destination[/b:cd532c38ee]

Put your sql dump in the mountpath (superuser)

Login in your docker container
[code:1:cd532c38ee]docker exec -i -t ID bash[/code:1:cd532c38ee]

Visit the mount partition
[code:1:cd532c38ee]cd destination[/code:1:cd532c38ee]

run your mysql import CLI command as usual

exit and remove your file

Share this:

Leave a Reply

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