From: Christopher Faulet Date: Tue, 17 Nov 2026 14:29:05 +0000 (+0100) Subject: DOC: config: update mysql-check doc for the auth switch support X-Git-Url: https://git.kaiwu.me/http/control.html?a=commitdiff_plain;h=5e4278b3876648d6b0d9f28bfa40ae89a2d62d95;p=haproxy.git DOC: config: update mysql-check doc for the auth switch support Document the behavior of the post-80 and post-80-sha2 modes when the authentication plugin of the check user differs from the announced one. --- diff --git a/doc/configuration.txt b/doc/configuration.txt index 9c5e2f5f6..67754a261 100644 --- a/doc/configuration.txt +++ b/doc/configuration.txt @@ -12099,22 +12099,28 @@ option mysql-check [ user [ { post-41 | pre-41 | post-80 | post-80-sh the only one enabled by default since MySQL 8.4. Example: CREATE USER 'haproxy'@'%' IDENTIFIED WITH caching_sha2_password BY ''; - The authentication plugin announced by the check must match the one of the - check user. Otherwise the server either rejects the handshake (error 1251 - with pre-41 and post-41) or replies with an authentication method switch - request that the check cannot answer (post-80, in which case the check is - still reported as passed). In both cases the server aborts the handshake and - counts it as a connection error for the HAProxy host. Once the host reaches - MySQL "max_connect_errors", the server refuses all connections from it, - including proxied client connections, until "FLUSH HOSTS" is issued. - - If you specify a username, the check consists of sending two MySQL packet, - one Client Authentication packet, and one QUIT packet, to correctly close - MySQL session. We then parse the MySQL Handshake Initialization packet and/or - Error packet. It is a basic but useful test which does not produce error nor - aborted connect on the server. However, it requires an unlocked authorised - user without a password. To create a basic limited user in MySQL with - optional resource limits: + With pre-41 and post-41, the authentication plugin announced by the check + must match the one of the check user. Otherwise the server rejects the + handshake with error 1251, aborts it and counts it as a connection error + for the HAProxy host. Once the host reaches MySQL "max_connect_errors", the + server refuses all connections from it, including proxied client + connections, until "FLUSH HOSTS" is issued. + + With post-80 and post-80-sha2, if the plugin does not match the one of the + check user, the server replies with an authentication method switch + request. The check answers with an empty password for the requested plugin, + reports the server as UP if the authentication succeeds and the session is + cleanly closed with a QUIT command, so no connection error is recorded on + the server. If the check user has a password, the full authentication + required by the server cannot be performed and the check fails. + + If you specify a username, the check consists of sending an authentication + packet followed by a QUIT packet to correctly close the MySQL session. We + then parse the MySQL Handshake Initialization packet, the authentication + result and any error packet. It is a basic but useful test which does not + produce error nor aborted connect on the server. However, it requires an + unlocked authorised user without a password. To create a basic limited user + in MySQL with optional resource limits: CREATE USER ''@'' /*!50701 WITH MAX_QUERIES_PER_HOUR 1 MAX_UPDATES_PER_HOUR 0 */