diff --git a/webapp/sql/init.sh b/webapp/sql/init.sh index 8f84f3c4a..4cee459cd 100755 --- a/webapp/sql/init.sh +++ b/webapp/sql/init.sh @@ -3,8 +3,12 @@ set -xe set -o pipefail CURRENT_DIR=$(cd $(dirname $0);pwd) -export MYSQL_PWD="isucari" +export MYSQL_HOST=${MYSQL_HOST:-127.0.0.1} +export MYSQL_PORT=${MYSQL_PORT:-3306} +export MYSQL_USER=${MYSQL_USER:-isucari} +export MYSQL_DBNAME=${MYSQL_DBNAME:-isucari} +export MYSQL_PASS=${MYSQL_PASS:-isucari} export LANG="C.UTF-8" cd $CURRENT_DIR -cat 01_schema.sql 02_categories.sql initial.sql | mysql --defaults-file=/dev/null -u isucari isucari +cat 01_schema.sql 02_categories.sql initial.sql | mysql --defaults-file=/dev/null -h $MYSQL_HOST -P $MYSQL_PORT -u $MYSQL_USER -p$MYSQL_PASS $MYSQL_DBNAME