Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mysqladmin command fix #197

Merged
merged 1 commit into from
Jan 2, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions quickstart-docker-compose/scripts/init-db-container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,14 @@ fi
# mysqladmin has been renamed to mariadb-admin and the old name produces deprecation warnings on newer releases.
# Use mariadb-admin if present
if command -v mariadb-admin >/dev/null 2>&1; then
DB_ADMIN_BINARY="mariadb-admin"
while ! mariadb-admin ping -h "${PULUMI_DATABASE_PING_ENDPOINT}" -P "${MYSQL_PORT}" --user="${MYSQL_ROOT_USERNAME}" --password="${MYSQL_ROOT_PASSWORD}" --skip-ssl --silent; do sleep 1; done
# Fall back to using mysqladmin
elif command -v mysqladmin >/dev/null 2>&1; then
DB_ADMIN_BINARY="mysqladmin"
while ! mysqladmin ping -h "${PULUMI_DATABASE_PING_ENDPOINT}" -P "${MYSQL_PORT}" --user="${MYSQL_ROOT_USERNAME}" --password="${MYSQL_ROOT_PASSWORD}" --silent; do sleep 1; done
else
echo "Neither mariadb-admin nor mysqladmin is available in the PATH."
exit 1
fi
echo "Using: $DB_ADMIN_BINARY"

# Check if the DB is ready.
while ! ${DB_ADMIN_BINARY} ping -h "${PULUMI_DATABASE_PING_ENDPOINT}" -P "${MYSQL_PORT}" --user="${MYSQL_ROOT_USERNAME}" --password="${MYSQL_ROOT_PASSWORD}" --skip-ssl --silent; do sleep 1; done

echo "MySQL is running!"

Expand Down
Loading