diff options
author | Jorge Hernandez <jorge.hernandez-herrero@att.com> | 2021-08-12 15:33:32 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2021-08-12 15:33:32 +0000 |
commit | 85b21b7f23ba8b4930a5f221ba1b35310afdbea8 (patch) | |
tree | 40bfb6294b59c0e8c2fd7c5a9a7fa4b0d7de8e2e /policy-management/src/main/server-gen | |
parent | 1c200701f248240aac226208d048c420fedd9c35 (diff) | |
parent | c34da31922d20ae675a5de6bc5c251598ae71ff5 (diff) |
Merge "Add SQL_PORT configuration"
Diffstat (limited to 'policy-management/src/main/server-gen')
-rw-r--r-- | policy-management/src/main/server-gen/bin/db-migrator | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/policy-management/src/main/server-gen/bin/db-migrator b/policy-management/src/main/server-gen/bin/db-migrator index 8ae2c7d4..b4602ea8 100644 --- a/policy-management/src/main/server-gen/bin/db-migrator +++ b/policy-management/src/main/server-gen/bin/db-migrator @@ -526,8 +526,12 @@ if [ -z "${SQL_HOST}" ] || [ -z "${SQL_USER}" ] || [ -z "${SQL_PASSWORD}" ]; the exit 4 fi -MYSQL="mysql -u${SQL_USER} -p${SQL_PASSWORD} -h ${SQL_HOST}"; -if ! ${MYSQL} -h"${SQL_HOST}" --execute "show databases;" > /dev/null 2>&1; then +if [ -z "${SQL_PORT}" ]; then + export SQL_PORT=3306 +fi + +MYSQL="mysql -u${SQL_USER} -p${SQL_PASSWORD} -h ${SQL_HOST} -P ${SQL_PORT}" +if ! ${MYSQL} --execute "show databases;" > /dev/null 2>&1; then echo "error: No DB connectivity to ${SQL_HOST} for ${SQL_USER}" exit 5 fi |