olafz / percona-clustercheck

Script to make a proxy (ie HAProxy) capable of monitoring Percona XtraDB Cluster nodes properly. The clustercheck script is distributed under the BSD license.
BSD 3-Clause "New" or "Revised" License
173 stars 108 forks source link

empty `MYSQL_USERNAME` is not possible #26

Open Cougar opened 5 years ago

Cougar commented 5 years ago

https://github.com/olafz/percona-clustercheck/blob/d5da8bed4ead8440dbef33c8959be42e37e881ae/clustercheck#L38

always sets MYSQL_USERNAME to "clustercheckuser" if it is missing or empty. This will add --user parameter here

https://github.com/olafz/percona-clustercheck/blob/d5da8bed4ead8440dbef33c8959be42e37e881ae/clustercheck#L49-L51

and with that it always overrides username in /etc/my.cnf.

The right expansion should be:

MYSQL_USERNAME="${MYSQL_USERNAME-clustercheckuser}"

Also look at https://github.com/olafz/percona-clustercheck/pull/23#issuecomment-468837312