TheRobotLearns Platform · ProxySQL: from first install to production
Handshake Behavior and Passthrough Authentication Configuration
Learning objectives
- Explain handshake difficulties when authentication methods switch with caching_sha2_password.
- Identify mysql-passthrough authentication variables, including enablement, TLS, and default hostgroup.
- Check default values for mysql-passthrough_auth_enabled and mysql-passthrough_auth_require_tls.
- Explain version-specific COM_CHANGE_USER limitations for caching_sha2_password clients.
- Relate passthrough configuration choices to frontend and backend authentication constraints.
Why handshake switching fails
You use caching_sha2_password on a connection, then ProxySQL must handle a method switch. ProxySQL supports distinct authentication mechanisms depending on the direction of the connection. Frontend authentication covers Clients → ProxySQL, and backend authentication covers ProxySQL → Databases. Both directions list caching_sha2_password, but version support changes the handshake story.
Before v2.0.2, ProxySQL has no caching_sha2_password support at all. From v2.0.2 through v2.5.x, frontend caching_sha2_password requires passwords stored in cleartext. From v2.6.0, ProxySQL has full caching_sha2_password support for both frontend and backend with flexible password storage. Backend caching_sha2_password also has full support from v2.6.0.
Switching authentication methods during handshakes presents challenges with caching_sha2_password. COM_CHANGE_USER is the change-user call used by connection-pool resets. For caching_sha2_password clients, that call fails in several cases on Stable v3.0, and on Innovation/AI-MCP up to v3.1.12 / v4.0.12. MariaDB clients using caching_sha2_password require the --ssl flag for versions before 10.10.
Takeaway: caching_sha2_password support, MariaDB --ssl behavior, and COM_CHANGE_USER failures all depend on versions.
Passthrough variables you set
The page's list of MySQL variables includes pass-through authentication names: mysql-passthrough_auth_enabled, mysql-passthrough_auth_empty_password, mysql-passthrough_auth_unknown_users, mysql-passthrough_auth_require_tls, mysql-passthrough_default_hg, mysql-passthrough_default_schema, mysql-passthrough_auth_cache_ttl_s, mysql-passthrough_auth_max_inflight_probes, mysql-passthrough_auth_username_pattern, mysql-passthrough_auth_max_failures_per_user, mysql-passthrough_auth_max_failures_per_ip, mysql-passthrough_auth_failure_window_s, and mysql-passthrough_auth_failure_map_cap.
The page describes pass-through behavior as follows:
- Frontend TLS is required before ProxySQL requests the cleartext credential used for a backend probe. With this enabled, an eligible non-TLS attempt fails with a generic access-denied response. Invalid values are rejected.
- A pass-through cache expires learned credentials after the specified number of seconds;
0means no time-based expiration. Out-of-range values are rejected. The cache remains non-persistent and local to the ProxySQL process. mysql-passthrough_auth_max_inflight_probescaps concurrent backend credential probes. Attempts above the cap fail with the generic authentication error. Out-of-range settings are rejected.- The failure limiter caps the distinct username and client-IP keys retained. Out-of-range settings are rejected. Reaching the cap bounds limiter memory rather than storing credentials.
Use the appropriate LOAD and SAVE commands to activate and persist configuration changes.
Move passthrough changes live
You set mysql-passthrough_auth_enabled=true, then ProxySQL still routes with the old setting. A change on the MySQL variables page must be explicitly loaded to the runtime to take effect. LOAD MYSQL VARIABLES TO RUNTIME moves the variable set into the runtime. SAVE MYSQL VARIABLES TO DISK persists the configuration.
This example enables passthrough auth, requires TLS, and sets the default hostgroup:
SET mysql-passthrough_auth_enabled=true;
SET mysql-passthrough_auth_require_tls=true;
SET mysql-passthrough_default_hg=0;
LOAD MYSQL VARIABLES TO RUNTIME;
SAVE MYSQL VARIABLES TO DISK;The first three SET statements choose the enablement, TLS, and default-hostgroup values. LOAD MYSQL VARIABLES TO RUNTIME makes the variable changes take effect in the runtime. SAVE MYSQL VARIABLES TO DISK stores the current configuration so it is persisted.
The same load-and-save sequence applies to mysql-passthrough_auth_unknown_users or mysql-passthrough_default_schema. If you only set values, the runtime has not taken them. If you load but do not save, the change is not persisted.
Takeaway: SET edits values, LOAD MYSQL VARIABLES TO RUNTIME activates them, and SAVE MYSQL VARIABLES TO DISK persists them.
What trips passthrough checks
You test a new password beginning with *, and the authentication method detection mechanism may fail. Passwords starting with * are a known authentication-method limitation. Authentication method switching during handshakes also presents challenges with caching_sha2_password.
caching_sha2_password is the version-sensitive method. Before v2.0.2, ProxySQL has no support for it. From v2.0.2 through v2.5.x, frontend caching_sha2_password requires cleartext passwords. From v2.6.0, full frontend and backend support exists.
MariaDB clients using caching_sha2_password require the --ssl flag for versions before 10.10. mysql-passthrough_auth_require_tls is a MySQL global variable with default true. mysql-passthrough_default_hg is a MySQL global variable with default 0. mysql-passthrough_auth_enabled defaults to false, and mysql-passthrough_auth_empty_password defaults to true.
COM_CHANGE_USER from caching_sha2_password clients fails in several cases on Stable v3.0, and on Innovation/AI-MCP up to v3.1.12 / v4.0.12. From v3.1.13 / v4.0.13, it authenticates the new user like a new connection would.
Takeaway: Check * password detection, MariaDB --ssl behavior, caching_sha2_password support levels, and COM_CHANGE_USER limits alongside passthrough variables.
Enable passthrough auth and persist it
SET mysql-passthrough_auth_enabled=true;
SET mysql-passthrough_auth_require_tls=true;
SET mysql-passthrough_default_hg=0;
LOAD MYSQL VARIABLES TO RUNTIME;
SAVE MYSQL VARIABLES TO DISK;The SET statements assign values to mysql-passthrough_auth_enabled, mysql-passthrough_auth_require_tls, and mysql-passthrough_default_hg. LOAD MYSQL VARIABLES TO RUNTIME makes the variable changes take effect in the runtime. SAVE MYSQL VARIABLES TO DISK persists the configuration.
Try it: config_layer_sim
You want passthrough authentication active, TLS required, and the default hostgroup set to 0. Run SET mysql-passthrough_auth_enabled=true; and SET mysql-passthrough_auth_require_tls=true;. Run SET mysql-passthrough_default_hg=0;.
Run LOAD MYSQL VARIABLES TO RUNTIME;. Run SAVE MYSQL VARIABLES TO DISK;. The runtime changes after LOAD MYSQL VARIABLES TO RUNTIME. The persisted state changes after SAVE MYSQL VARIABLES TO DISK.
Sources
- Authentication Methods
- Authentication Methods
- Authentication Methods
- Authentication Methods
- Authentication Methods
- MySQL Variables
- MySQL Variables
- MySQL Variables
- MySQL Variables
- MySQL Variables
- MySQL Variables
- MySQL Variables
- MySQL Variables
- MySQL Variables
- Authentication Methods
- Authentication Methods
- Authentication Methods
- Authentication Methods
- Authentication Methods
- Authentication Methods
- MySQL Variables
- MySQL Variables
- MySQL Variables
- MySQL Variables
- MySQL Variables
- MySQL Variables
- MySQL Variables
- MySQL Variables
- MySQL Variables
- Authentication Methods
Do more with an account
- Graded quizzes is available on your account.
- Saving your progress is available on your account.
- Hands-on labs is available on your account.
- AI tutoring is available on your account.