Add MYSQL_CLIENT_EXTRA_PARAMS env var
Some checks failed
Docker Image CI / build-recursor-latest (push) Has been cancelled
Docker Image CI / build-recursor-alpine (push) Has been cancelled
Docker Image CI / build-pdns-mysql-latest (push) Has been cancelled
Docker Image CI / build-pdns-mysql-alpine (push) Has been cancelled
Docker Image CI / build-pdns-pgsql-latest (push) Has been cancelled
Docker Image CI / build-pdns-pgsql-alpine (push) Has been cancelled
Docker Image CI / build-pdns-admin (push) Has been cancelled

So it's possible to set custom parameters for mysql client program.

Fixes #147
This commit is contained in:
Peter Schiffer 2025-01-03 15:33:08 +01:00
parent 9618517672
commit 74db3e6639
No known key found for this signature in database
GPG key ID: F2A18AC34A008397

View file

@ -38,20 +38,20 @@ deriveMySQLSettingsFromEnvironment() {
} }
generateMySQLCommand() { generateMySQLCommand() {
EXTRA='' : "${MYSQL_CLIENT_EXTRA_PARAMS:=}"
# Password Auth # Password Auth
if [ "${PDNS_gmysql_password}" ]; then if [ "${PDNS_gmysql_password:-}" ]; then
EXTRA="${EXTRA} -p${PDNS_gmysql_password}" MYSQL_CLIENT_EXTRA_PARAMS="${MYSQL_CLIENT_EXTRA_PARAMS} -p${PDNS_gmysql_password}"
fi fi
# Allow socket connections # Allow socket connections
if [ "${PDNS_gmysql_socket:-}" ]; then if [ "${PDNS_gmysql_socket:-}" ]; then
export PDNS_gmysql_host='localhost' export PDNS_gmysql_host='localhost'
EXTRA="${EXTRA} --socket=${PDNS_gmysql_socket}" MYSQL_CLIENT_EXTRA_PARAMS="${MYSQL_CLIENT_EXTRA_PARAMS} --socket=${PDNS_gmysql_socket}"
fi fi
MYSQL_COMMAND="mariadb -h ${PDNS_gmysql_host} -P ${PDNS_gmysql_port} -u ${PDNS_gmysql_user}${EXTRA}" MYSQL_COMMAND="mariadb -h ${PDNS_gmysql_host} -P ${PDNS_gmysql_port} -u ${PDNS_gmysql_user} ${MYSQL_CLIENT_EXTRA_PARAMS}"
} }
createDatabaseIfRequested() { createDatabaseIfRequested() {