From: Ramesh Parthasarathy Date: Mon, 18 Mar 2019 00:52:00 +0000 (-0700) Subject: Altered create database db statements X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=758b2c4b6202078961d665a1ab9db5e72e341516;p=so%2Fdocker-config.git Altered create database db statements Create user seems to fail every time So added drop user statement to overcome Change-Id: Ie50085771d38759c5b7792515ac2f199a5d6530e Issue-ID: SO-1674 Signed-off-by: Ramesh Parthasarathy(rp6768) --- diff --git a/volumes/mariadb/docker-entrypoint-initdb.d/01-create-camundabpmn.sh b/volumes/mariadb/docker-entrypoint-initdb.d/01-create-camundabpmn.sh index 4892525..d7acfed 100644 --- a/volumes/mariadb/docker-entrypoint-initdb.d/01-create-camundabpmn.sh +++ b/volumes/mariadb/docker-entrypoint-initdb.d/01-create-camundabpmn.sh @@ -27,6 +27,7 @@ mysql -uroot -p$MYSQL_ROOT_PASSWORD << 'EOF' || exit 1 DROP DATABASE IF EXISTS `camundabpmn`; CREATE DATABASE `camundabpmn`; DELETE FROM mysql.user WHERE User='camundauser'; +DROP USER 'camundauser'; CREATE USER 'camundauser'; GRANT ALL on camundabpmn.* to 'camundauser' identified by 'camunda123' with GRANT OPTION; FLUSH PRIVILEGES; diff --git a/volumes/mariadb/docker-entrypoint-initdb.d/02-create-requestdb.sh b/volumes/mariadb/docker-entrypoint-initdb.d/02-create-requestdb.sh index f2231b6..dd51d80 100644 --- a/volumes/mariadb/docker-entrypoint-initdb.d/02-create-requestdb.sh +++ b/volumes/mariadb/docker-entrypoint-initdb.d/02-create-requestdb.sh @@ -27,6 +27,7 @@ mysql -uroot -p$MYSQL_ROOT_PASSWORD << 'EOF' || exit 1 DROP DATABASE IF EXISTS `requestdb`; CREATE DATABASE /*!32312 IF NOT EXISTS*/ `requestdb` /*!40100 DEFAULT CHARACTER SET latin1 */; DELETE FROM mysql.user WHERE User='requestuser'; +DROP USER 'requestuser'; CREATE USER 'requestuser'; GRANT ALL on requestdb.* to 'requestuser' identified by 'request123' with GRANT OPTION; FLUSH PRIVILEGES; diff --git a/volumes/mariadb/docker-entrypoint-initdb.d/03-create-catalogdb.sh b/volumes/mariadb/docker-entrypoint-initdb.d/03-create-catalogdb.sh index e47229c..aa47f65 100644 --- a/volumes/mariadb/docker-entrypoint-initdb.d/03-create-catalogdb.sh +++ b/volumes/mariadb/docker-entrypoint-initdb.d/03-create-catalogdb.sh @@ -27,6 +27,7 @@ mysql -uroot -p$MYSQL_ROOT_PASSWORD << 'EOF' || exit 1 DROP DATABASE IF EXISTS `catalogdb`; CREATE DATABASE /*!32312 IF NOT EXISTS*/ `catalogdb` /*!40100 DEFAULT CHARACTER SET latin1 */; DELETE FROM mysql.user WHERE User='cataloguser'; +DROP USER 'cataloguser'; CREATE USER 'cataloguser'; GRANT ALL on catalogdb.* to 'cataloguser' identified by 'catalog123' with GRANT OPTION; FLUSH PRIVILEGES;