From c34da31922d20ae675a5de6bc5c251598ae71ff5 Mon Sep 17 00:00:00 2001 From: jhh Date: Mon, 9 Aug 2021 19:54:55 -0500 Subject: Add SQL_PORT configuration Issue-ID: POLICY-3533 Change-Id: I03fc41332d4739d5a4d6cee5f86ba823714336d6 Signed-off-by: jhh --- policy-management/src/main/server-gen/bin/db-migrator | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'policy-management/src/main/server-gen/bin') 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 -- cgit 1.2.3-korg