Skip to content

Instantly share code, notes, and snippets.

@jwdeane
Created March 27, 2019 22:24
Show Gist options
  • Save jwdeane/568989fc93a95aa8eb48e6b1bd2b19c7 to your computer and use it in GitHub Desktop.
Save jwdeane/568989fc93a95aa8eb48e6b1bd2b19c7 to your computer and use it in GitHub Desktop.
Import SQL dump into Docker container
# Grab and run MariaDB image
docker run --name mariadb -p 3306:3306 -e MYSQL_ROOT_PASSWORD=secret -e MYSQL_DATABASE=db -d mariadb:latest
# Restore a dump into the DB
docker exec -i mariadb mysql -uroot -psecret --database=db < dump.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment