Skip to content

Instantly share code, notes, and snippets.

@wimvds
Created December 14, 2016 09:31
Show Gist options
  • Save wimvds/c079b38deeb48319dca4f47d264b2049 to your computer and use it in GitHub Desktop.
Save wimvds/c079b38deeb48319dca4f47d264b2049 to your computer and use it in GitHub Desktop.
Run mysql command in (currently running) mariadb docker container
#!/bin/bash
if [ -t 0 ]; then
# Terminal input (keyboard) - interactive
docker exec -it mariadb mysql $@
else
# File or pipe input - non-interactive
docker exec -i mariadb mysql $@
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment