Last active
July 27, 2016 10:54
-
-
Save 1d10t/54f5e3d4ae928e4c5ce3b3bb68f6c2bf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
DOMAIN=`basename \`pwd\`` | |
MYSQL_CNF="../mysql_"$DOMAIN".cnf" | |
MYSQL_DB_FILE="../mysql_"$DOMAIN".db" | |
MYSQL_DB="" | |
if [ -f $MYSQL_DB_FILE ] | |
then | |
MYSQL_DB=`cat $MYSQL_DB_FILE` | |
fi | |
MYSQL_CNF_ARG="" | |
if [ -f $MYSQL_CNF ] | |
then | |
MYSQL_CNF_ARG="--defaults-extra-file="$MYSQL_CNF | |
fi | |
mysql $MYSQL_CNF_ARG $MYSQL_DB |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[client] | |
user = USER | |
password = PASS | |
host = HOST |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment