diff options
author | Ramesh Murugan Iyer <ramesh.murugan.iyer@est.tech> | 2022-06-22 08:49:59 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2022-06-22 08:49:59 +0000 |
commit | 8dc83784673a5ccad79fc534bb7f035be8c16392 (patch) | |
tree | e81131672d3fffd25cefe965e9c30c6d49823b0b /policy-management/src/main/server-gen | |
parent | 55fb33c1c62d16b2e0e08ab0e8ff5d64d12d1aea (diff) | |
parent | e404c65df661b49d844b2f67fa0076a3a960554a (diff) |
Merge "Allow for flexible specification of JDBC driver"
Diffstat (limited to 'policy-management/src/main/server-gen')
-rw-r--r-- | policy-management/src/main/server-gen/bin/db-migrator | 9 |
1 files changed, 7 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 b4602ea8..64d0fcf1 100644 --- a/policy-management/src/main/server-gen/bin/db-migrator +++ b/policy-management/src/main/server-gen/bin/db-migrator @@ -3,7 +3,7 @@ # ============LICENSE_START======================================================= # ONAP # ================================================================================ -# Copyright (C) 2017-2021 AT&T Intellectual Property. All rights reserved. +# Copyright (C) 2017-2022 AT&T Intellectual Property. All rights reserved. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -530,7 +530,12 @@ 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 [ -z "$MYSQL_CMD" ]; then + MYSQL_CMD="mysql" +fi + +MYSQL="${MYSQL_CMD} -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 |