diff --git a/conf/type/__mysql_database/gencode-remote b/conf/type/__mysql_database/gencode-remote index fdfb1501..9001ac99 100755 --- a/conf/type/__mysql_database/gencode-remote +++ b/conf/type/__mysql_database/gencode-remote @@ -26,9 +26,11 @@ else # otherwise use the object id as database name database="$__object_id" fi -mysql -u root -p <<-EOF +cat <<-EOFF +mysql -u root <<-EOF CREATE DATABASE IF NOT EXISTS $database EOF +EOFF # if --user was specified if [ -f "$__object/parameter/user" ]; then @@ -37,12 +39,17 @@ if [ -f "$__object/parameter/user" ]; then # if --password was specified if [ -f "$__object/parameter/password" ]; then password="$(cat "$__object/parameter/password")" - mysql -u root -p <<-EOF + cat <<-EOFF + mysql -u root <<-EOF GRANT ALL PRIVILEGES ON $database.* to '$user'@'localhost' IDENTIFIED BY '$password'; - EOF +EOF +EOFF else - mysql -u root -p <<-EOF + password="" + cat <<-EOFF + mysql -u root <<-EOF GRANT ALL PRIVILEGES ON $database.* to '$user'@'localhost'; - EOF +EOF +EOFF fi fi