Skip to content

Instantly share code, notes, and snippets.

@r3vit
Last active June 10, 2017 10:20
Show Gist options
  • Save r3vit/bc6f6c2be29a9fe270d1df62629f5402 to your computer and use it in GitHub Desktop.
Save r3vit/bc6f6c2be29a9fe270d1df62629f5402 to your computer and use it in GitHub Desktop.
Start a mysql docker container and restore your dump.sql
#!/bin/sh
#clear
docker stop CONTAINER
docker rm CONTAINER
#start new mysql service at port :3306 with password:root
docker run --name CONTAINER -p 3306:3306 -e MYSQL_ROOT_PASSWORD=root -d mysql
#start mysql service
docker exec CONTAINER service mysql start
#restore brexit.sql (same folder)
docker exec -i CONTAINER /usr/bin/mysql -u root --password=root < DUMP.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment