#!/usr/bin/env bash set -euo pipefail # Runs once on first cluster init (empty datadir), the analogue of # init_pgpool_user.sql. Creates the infrastructure accounts (MaxScale monitor + # service, and the replication user) on the backend. All use native password # auth (NOT pam) — they are service accounts, not human AD logins. Passwords # come from the environment so nothing secret is committed to a .sql file, and # the root password goes via MYSQL_PWD (read by the client) rather than -p so it # never appears in the process list. : "${MARIADB_ROOT_PASSWORD:?}" : "${MAXSCALE_MONITOR_PASSWORD:?}" : "${MAXSCALE_SERVICE_PASSWORD:?}" : "${MARIADB_REPL_PASSWORD:?}" MYSQL_PWD="${MARIADB_ROOT_PASSWORD}" mariadb --protocol=socket -uroot <