summaryrefslogtreecommitdiffstats
path: root/policy-management/src/main/server-gen
diff options
context:
space:
mode:
authorjhh <jorge.hernandez-herrero@att.com>2021-08-09 19:54:55 -0500
committerjhh <jorge.hernandez-herrero@att.com>2021-08-10 12:23:13 -0500
commitc34da31922d20ae675a5de6bc5c251598ae71ff5 (patch)
treebbc155f6d07ee3609b0780f6c81e412194830f8e /policy-management/src/main/server-gen
parent2416b2db724a187001830d4573b888f8367b37a4 (diff)
Add SQL_PORT configuration
Issue-ID: POLICY-3533 Change-Id: I03fc41332d4739d5a4d6cee5f86ba823714336d6 Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Diffstat (limited to 'policy-management/src/main/server-gen')
-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