TheRobotLearns Platform · ProxySQL: from first install to production

Navigating the MySQL Variable Family

  • about 15 min read

Learning objectives

  • Locate mysql-* entries and their default value column in the MySQL Variables list.
  • State that MySQL variable changes require explicit runtime loading before they take effect.
  • Distinguish detailed entries such as audit, connection, and monitoring within the MySQL Variables list.

Find a value, read its default

You can find a shown value by reading the sample proxysql.cnf configuration file shown for development and testing. In its mysql_variables block, settings appear as name=value, so the value shown for that setting follows the equals sign. For example, the sample shows threads=4, max_connections=2048, default_schema="information_schema", interfaces="0.0.0.0:6033", commands_stats=true, and connect_timeout_server=3000. It also shows admin_variables with mysql_ifaces="0.0.0.0:6032".

Before the first start, edit /etc/proxysql.cnf, replace the sample Admin credentials, restrict admin_variables.mysql_ifaces to trusted interfaces, and review every other listener.

Takeaway: Look up the value in the sample mysql_variables assignments, and edit /etc/proxysql.cnf before starting ProxySQL.

Load the change before trusting it

You set mysql-auditlog_filename to a base name, and that setting automatically enables Audit Log. The change still does not take effect until you explicitly load it to the runtime. A change made in the MySQL Variables list must be loaded to the runtime to take effect.

mysql-auditlog_filename defines the base name where audit events are logged, and the file name includes an eight-digit progressive number. Files are rotated based on mysql-auditlog_filesize, whose default is 104857600 (100MB). The list also has audit variables with other values, such as mysql-auditlog_flush_size with 4096 and mysql-auditlog_flush_timeout with 1000. The list shows mysql-eventslog_filename with a blank default, mysql-eventslog_filesize with 104857600, and mysql-eventslog_flush_size with 4096. You can click a variable name to jump to its definition.

LOAD and SAVE are the commands named for these configuration changes. The runtime is the place the change must be loaded into.

Takeaway: Change a mysql-* row, load it to runtime, and the change takes effect only then.

Tell audit, connection, and events rows apart

The ProxySQL configuration sample groups settings under admin_variables and mysql_variables. In the mysql_variables block, it sets connect_timeout_server=3000, commands_stats=true, and connect_retries_on_failure=10.

Use the exact names visible in that block to tell entries apart. connect_timeout_server and connect_retries_on_failure share the leading connect_, while commands_stats has a separate name and the value true. Keep each value with the entry shown: 3000 with connect_timeout_server, true with commands_stats, and 10 with connect_retries_on_failure.

Takeaway: Use visible configuration names—especially the connect_ entries and commands_stats—rather than mixing entries by assumption.

Use definitions and version rows carefully

Installation guidance defines supported operating system versions in a table. RedHat & CentOS lists 10, 9, 8*, 7*; Amazon Linux lists 2023, 2*; Debian lists 13, 12, 11*, 10*; Ubuntu lists 24, 22, 20*, 18*, 16*; Almalinux lists 10, 9, 8; OpenSUSE Leap lists 15, 16. The footnote defines * as ProxySQL v2.7.x and older releases only.

The maintained release list includes ProxySQL Core 3.0.x Series (GA), 2.7.x Series (GA), 2.6.x Series (GA), 2.5.x Series (GA), 2.4.x Series (GA), 2.3.x Series (GA), 2.2.x Series (GA), and ProxySQL Binlog Reader 2.x Series (GA).

The repository commands also include series names such as proxysql-3.0.x. For Ubuntu/Debian, replace proxysql-3.0.x in the repository URL with proxysql-2.7.x, proxysql-2.6.x, etc. for older series. For Amazon Linux, use CentOS packages: CentOS 9 for Amazon Linux 2023; CentOS 7 for Amazon Linux 2.

Generic tarball names use proxysql-<version>-linux-amd64.tar.gz or proxysql-<version>-linux-arm64.tar.gz. The guidance says to set PROXYSQL_VERSION explicitly rather than copying a version from the page. Generic tarballs are built on AlmaLinux 9 and target Linux systems with glibc 2.34 or newer and OpenSSL 3. Unlike a distribution package, a generic tarball does not create the service account, install files into system paths, or register the service. The operator owns those steps and the upgrade/rollback procedure.

Takeaway: Compare supported OS rows, footnote definitions, maintained release rows, repository series, and package-versus-tarball behavior.

Copy three MySQL Variables rows into a check

SELECT 'mysql-auditlog_filename' AS variable_name, '' AS default_value
UNION ALL
SELECT 'mysql-auditlog_filesize', '100MB'
UNION ALL
SELECT 'mysql-have_ssl', 'true (since v2.6.0)';

This SQL returns three rows copied from the MySQL Variables list as literal values. The first SELECT row shows mysql-auditlog_filename with a blank default value. The second row shows mysql-auditlog_filesize with 100MB. The third row shows mysql-have_ssl with true (since v2.6.0). A change to a MySQL Variables row must be explicitly loaded to the runtime to take effect.

Try it: config_layer_sim

You set mysql-auditlog_filename in the MySQL Variables list. The detailed entry says setting this variable automatically enables Audit Log. The change must be explicitly loaded to the runtime to take effect. You click the variable name to jump to its definition.

Sources

Do more with an account

Navigating the MySQL Variable Family — ProxySQL: from first install to production