aboutsummaryrefslogtreecommitdiffstats
path: root/policy-management/src
diff options
context:
space:
mode:
authorJorge Hernandez <jorge.hernandez-herrero@att.com>2021-08-12 15:33:32 +0000
committerGerrit Code Review <gerrit@onap.org>2021-08-12 15:33:32 +0000
commit85b21b7f23ba8b4930a5f221ba1b35310afdbea8 (patch)
tree40bfb6294b59c0e8c2fd7c5a9a7fa4b0d7de8e2e /policy-management/src
parent1c200701f248240aac226208d048c420fedd9c35 (diff)
parentc34da31922d20ae675a5de6bc5c251598ae71ff5 (diff)
Merge "Add SQL_PORT configuration"
Diffstat (limited to 'policy-management/src')
-rw-r--r--policy-management/src/main/server-gen/bin/db-migrator8
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