diff --git a/make_db b/make_db index ea462608a58b0236f1380ccac0e90174158bf9f4..24a12855533579372bd16f874c0167c95794fd3e 100755 --- a/make_db +++ b/make_db @@ -50,10 +50,10 @@ function setup_os() { function install_db() { if _db_exists ; then echo -e "\n -A database with with the name `$DATABASE_NAME` exists already. -Call `make drop-$DATABASE_NAME` to delete that database or reconfigure with +A database with with the name '$DATABASE_NAME' exists already. +Call 'make drop-$DATABASE_NAME' to delete that database or reconfigure with './configure'." - exit 1 + exit 0 fi sed "s/db_2_0/$DATABASE_NAME/g" "$INSTALL_SQL_FILE" | $SQL @@ -82,7 +82,8 @@ function grant() { for host in ${DATABASE_USER_HOST_LIST//,/ } ; do $SQL <<EOF -CREATE USER '$DATABASE_USER'@'$host' identified by '$DATABASE_USER_PW'; +CREATE USER IF NOT EXISTS + '$DATABASE_USER'@'$host' identified by '$DATABASE_USER_PW'; GRANT USAGE ON *.* TO '$DATABASE_USER'@'$host'; GRANT ALL PRIVILEGES ON *.* TO '$DATABASE_USER'@'$host' WITH GRANT OPTION; GRANT EXECUTE ON *.* TO '$DATABASE_USER'@'$host';