Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env bash
- DB_USER="???"
- DB_PASS="???"
- DB_HOST="???"
- if [ ! "$DB_USER" ] || [ ! "$DB_PASS" ] || [ ! "$DB_HOST" ]; then
- echo "You need to set DB_USER, DB_PASS and DB_HOST environmental variables."
- exit 1
- fi
- # escape new lines and backticks
- mysql -u${DB_USER} \
- -p${DB_PASS} \
- -h${DB_HOST} \
- my_db_name -e "SELECT * \
- FROM \`foo\`.\`bar\` fb";
Add Comment
Please, Sign In to add comment