From d81496cabe6c0dfeadbb4dc1852a3d336032c576 Mon Sep 17 00:00:00 2001 From: garciadeblas Date: Wed, 19 Apr 2017 18:17:11 +0200 Subject: [PATCH] install_db_server does not drop the user if exists Change-Id: Ia4f3dfa70ba8d1e273fdfda837a5d16a0aacb414 Signed-off-by: garciadeblas --- scripts/install-db-server.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/install-db-server.sh b/scripts/install-db-server.sh index ec0dd6cd..26738a67 100755 --- a/scripts/install-db-server.sh +++ b/scripts/install-db-server.sh @@ -167,8 +167,7 @@ if db_exists "mano_db" $TEMPFILE ; then #echo "REVOKE ALL PRIVILEGES ON mano_db.* FROM 'mano'@'localhost';" | mysql --defaults-extra-file=$TEMPFILE -s || ! echo "Failed while creating user mano at database" || exit 1 #echo "DELETE USER 'mano'@'localhost';" | mysql --defaults-extra-file=$TEMPFILE -s || ! echo "Failed while creating user mano at database" || exit 1 mysqladmin --defaults-extra-file=$TEMPFILE -s create mano_db || ! echo "Error creating mano_db database" || exit 1 - echo "DROP USER 'mano'@'localhost';" | mysql --defaults-extra-file=$TEMPFILE -s || ! echo "Failed while creating user mano at database" || exit 1 - echo "CREATE USER 'mano'@'localhost' identified by 'manopw';" | mysql --defaults-extra-file=$TEMPFILE -s || ! echo "Failed while creating user mano at database" || exit 1 + echo "CREATE USER 'mano'@'localhost' identified by 'manopw';" | mysql --defaults-extra-file=$TEMPFILE -s || ! echo "Failed while creating user mano at database" echo "GRANT ALL PRIVILEGES ON mano_db.* TO 'mano'@'localhost';" | mysql --defaults-extra-file=$TEMPFILE -s || ! echo "Failed while creating user mano at database" || exit 1 echo " Database 'mano_db' created, user 'mano' password 'manopw'" else -- 2.25.1