diff options
author | Sylvain Desbureaux <sylvain.desbureaux@orange.com> | 2021-03-22 07:19:08 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2021-03-22 07:19:08 +0000 |
commit | 5ac7099caeabb158f29f6c1bf7fb56043c38bc90 (patch) | |
tree | 359c428d5fce52a864404f9e511611494dd62495 /kubernetes | |
parent | 6b50fc05d22fa2e9cfc45c766a4da4076462c3f6 (diff) | |
parent | a72340f91c9d12c9bdcdf8d3b514ac01ec177be7 (diff) |
Merge "[SDNC] Check existance of DB user before creation"
Diffstat (limited to 'kubernetes')
-rwxr-xr-x | kubernetes/sdnc/resources/config/bin/installSdncDb.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kubernetes/sdnc/resources/config/bin/installSdncDb.sh b/kubernetes/sdnc/resources/config/bin/installSdncDb.sh index 11ed7f45bf..42abf54444 100755 --- a/kubernetes/sdnc/resources/config/bin/installSdncDb.sh +++ b/kubernetes/sdnc/resources/config/bin/installSdncDb.sh @@ -37,8 +37,8 @@ SDNC_DB_DATABASE=${SDNC_DB_DATABASE} # Create tablespace and user account mysql -h ${MYSQL_HOST} -u root -p${MYSQL_PASSWORD} mysql <<-END CREATE DATABASE IF NOT EXISTS ${SDNC_DB_DATABASE}; -CREATE USER '${SDNC_DB_USER}'@'localhost' IDENTIFIED BY '${SDNC_DB_PASSWORD}'; -CREATE USER '${SDNC_DB_USER}'@'%' IDENTIFIED BY '${SDNC_DB_PASSWORD}'; +CREATE USER IF NOT EXISTS '${SDNC_DB_USER}'@'localhost' IDENTIFIED BY '${SDNC_DB_PASSWORD}'; +CREATE USER IF NOT EXISTS '${SDNC_DB_USER}'@'%' IDENTIFIED BY '${SDNC_DB_PASSWORD}'; GRANT ALL PRIVILEGES ON ${SDNC_DB_DATABASE}.* TO '${SDNC_DB_USER}'@'localhost' WITH GRANT OPTION; GRANT ALL PRIVILEGES ON ${SDNC_DB_DATABASE}.* TO '${SDNC_DB_USER}'@'%' WITH GRANT OPTION; flush privileges; |