Skip to content

Instantly share code, notes, and snippets.

@1d10t
Last active July 27, 2016 10:54
Show Gist options
  • Save 1d10t/54f5e3d4ae928e4c5ce3b3bb68f6c2bf to your computer and use it in GitHub Desktop.
Save 1d10t/54f5e3d4ae928e4c5ce3b3bb68f6c2bf to your computer and use it in GitHub Desktop.
#!/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
[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