Skip to content
Snippets Groups Projects
Commit ddc53f18 authored by Daniel's avatar Daniel
Browse files

WIP: More relaxed make_db script.

parent d3fea97e
No related branches found
No related tags found
No related merge requests found
...@@ -50,10 +50,10 @@ function setup_os() { ...@@ -50,10 +50,10 @@ function setup_os() {
function install_db() { function install_db() {
if _db_exists ; then if _db_exists ; then
echo -e "\n echo -e "\n
A database with with the name `$DATABASE_NAME` exists already. A database with with the name '$DATABASE_NAME' exists already.
Call `make drop-$DATABASE_NAME` to delete that database or reconfigure with Call 'make drop-$DATABASE_NAME' to delete that database or reconfigure with
'./configure'." './configure'."
exit 1 exit 0
fi fi
sed "s/db_2_0/$DATABASE_NAME/g" "$INSTALL_SQL_FILE" | $SQL sed "s/db_2_0/$DATABASE_NAME/g" "$INSTALL_SQL_FILE" | $SQL
...@@ -82,7 +82,8 @@ function grant() { ...@@ -82,7 +82,8 @@ function grant() {
for host in ${DATABASE_USER_HOST_LIST//,/ } ; do for host in ${DATABASE_USER_HOST_LIST//,/ } ; do
$SQL <<EOF $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 USAGE ON *.* TO '$DATABASE_USER'@'$host';
GRANT ALL PRIVILEGES ON *.* TO '$DATABASE_USER'@'$host' WITH GRANT OPTION; GRANT ALL PRIVILEGES ON *.* TO '$DATABASE_USER'@'$host' WITH GRANT OPTION;
GRANT EXECUTE ON *.* TO '$DATABASE_USER'@'$host'; GRANT EXECUTE ON *.* TO '$DATABASE_USER'@'$host';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment