Skip to content

Instantly share code, notes, and snippets.

@MEGApixel23
Created June 14, 2017 07:34
Show Gist options
  • Save MEGApixel23/7b00904e8e1f4a66145ed50e2685a9d6 to your computer and use it in GitHub Desktop.
Save MEGApixel23/7b00904e8e1f4a66145ed50e2685a9d6 to your computer and use it in GitHub Desktop.
cli tool for importing sql file to MySQL database inside docker container
#!/usr/bin/env bash
read -p "Container name: " container_name
read -p "username: " username
read -p "password: " password
read -p "database: " database
read -p ".sql path: " sql_file
script=exec docker exec -i $container_name mysql -u$username -p$password $database < $sql_file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment