Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
8 lines (6 sloc) 371 Bytes
#!/bin/bash
sqlname=`sed -n "s/.*\(['\"]\)DB_NAME\1\s*,\s*\(['\"]\)\(.*\)\2.*/\3/p" $1`
sqluser=`sed -n "s/.*\(['\"]\)DB_USER\1\s*,\s*\(['\"]\)\(.*\)\2.*/\3/p" $1`
sqlhost=`sed -n "s/.*\(['\"]\)DB_HOST\1\s*,\s*\(['\"]\)\(.*\)\2.*/\3/p" $1`
sqlpass=`sed -n "s/.*\(['\"]\)DB_PASSWORD\1\s*,\s*\(['\"]\)\(.*\)\2.*/\3/p" $1`
mysql -h $sqlhost -u $sqluser -p$sqlpass $sqlname