diff --git a/config/easyengine/ee.conf b/config/easyengine/ee.conf index 286f105e..d34a2e21 100644 --- a/config/easyengine/ee.conf +++ b/config/easyengine/ee.conf @@ -6,7 +6,7 @@ ip-address = [mysql] - client-host = localhost + grant-host = localhost db-name = false db-user = false diff --git a/src/lib/ee_lib_variables.sh b/src/lib/ee_lib_variables.sh index 82df02c2..7a1a767d 100644 --- a/src/lib/ee_lib_variables.sh +++ b/src/lib/ee_lib_variables.sh @@ -46,8 +46,8 @@ else fi # Find out MySQL client-host to setup grants -if [ -z $($EE_CONFIG_GET mysql.client-host) ]; then - readonly EE_MYSQL_CLIENT_HOST=localhost +if [ -z $($EE_CONFIG_GET mysql.grant-host) ]; then + readonly EE_MYSQL_GRANT_HOST=localhost else - readonly EE_MYSQL_CLIENT_HOST=$($EE_CONFIG_GET mysql.client-host) + readonly EE_MYSQL_GRANT_HOST=$($EE_CONFIG_GET mysql.grant-host) fi diff --git a/src/modules/site/create/ee_mod_setup_database.sh b/src/modules/site/create/ee_mod_setup_database.sh index 4afe9fc2..a8c53d2b 100644 --- a/src/modules/site/create/ee_mod_setup_database.sh +++ b/src/modules/site/create/ee_mod_setup_database.sh @@ -51,16 +51,16 @@ function ee_mod_setup_database() fi # Create MySQL database - echo -e "EE_DB_NAME = $EE_DB_NAME \nEE_DB_USER = $EE_DB_USER \nEE_DB_PASS = $EE_DB_PASS \nEE_MYSQL_HOST = $EE_MYSQL_HOST \nEE_MYSQL_CLIENT_HOST = $EE_MYSQL_CLIENT_HOST" &>> $EE_COMMAND_LOG + echo -e "EE_DB_NAME = $EE_DB_NAME \nEE_DB_USER = $EE_DB_USER \nEE_DB_PASS = $EE_DB_PASS \nEE_MYSQL_HOST = $EE_MYSQL_HOST \nEE_MYSQL_GRANT_HOST = $EE_MYSQL_GRANT_HOST" &>> $EE_COMMAND_LOG mysql -e "create database \`$EE_DB_NAME\`" \ || ee_lib_error "Unable to create $EE_DB_NAME database, exit status = " $? # Create MySQL User - mysql -e "create user '$EE_DB_USER'@'$EE_MYSQL_CLIENT_HOST' identified by '$EE_DB_PASS'" \ + mysql -e "create user '$EE_DB_USER'@'$EE_MYSQL_GRANT_HOST' identified by '$EE_DB_PASS'" \ || ee_lib_error "Unable to create $EE_DB_USER database user, exit status = " $? # Grant permission - mysql -e "grant all privileges on \`$EE_DB_NAME\`.* to '$EE_DB_USER'@'$EE_MYSQL_CLIENT_HOST'" \ + mysql -e "grant all privileges on \`$EE_DB_NAME\`.* to '$EE_DB_USER'@'$EE_MYSQL_GRANT_HOST'" \ || ee_lib_error "Unable to grant privileges for $EE_DB_USER database user, exit status = " $? mysql -e "flush privileges" }