TheRobotLearns Platform · ProxySQL: from first install to production

Admin Variables and Web Interface Settings

  • about 15 min read

Learning objectives

  • Identify admin variables including admin-mysql_ifaces and admin-stats_credentials in Quick Reference.
  • Navigate admin variable material covering web-enablement, web-port, and verbosity settings.
  • Use the admin load and save commands after modifying admin variables.

Why the change waits

You edit mysql-auditlog_filename to audit.log, but no audit files appear. The page note says changes on this page must be explicitly loaded to the runtime before they take effect. The runtime is the area where loaded configuration takes effect. The note points to the LOAD and SAVE commands in Admin Commands.

The variables list is where you confirm names and defaults. For example, mysql-auditlog_filename has no default, and setting it automatically enables Audit Log. It defines a base file name, and each file gets an 8 digit progressive number. Rotation depends on mysql-auditlog_filesize.

Treat the list as a checklist: find the variable, read its definition, then apply the load step. If you only change the variable value, the runtime does not take effect until you load it. The note includes SAVE commands with LOAD, so use the matching commands after your edit.

Takeaway: After editing a MySQL Variable, use the LOAD command to make it live, and the SAVE command listed with it.

Find variables in the list

ProxySQL configuration examples list variable names. In the Docker configuration, datadir appears at the top level, admin_variables contains admin_credentials and mysql_ifaces, and mysql_variables contains settings such as threads, max_connections, interfaces, default_schema, server_version, monitor_username, and monitor_password. When installing from a generic Linux tarball, edit /etc/proxysql.cnf before first start, replace the sample Admin credentials, restrict admin_variables.mysql_ifaces to trusted interfaces, and review every other listener.

Watch versioned and dynamic rows

When you use the install page, read version footnotes. The supported OS table marks RedHat & CentOS 8 and 7, Amazon Linux 2, Debian 11 and 10, and Ubuntu 20, 18, and 16 with *; the note says ProxySQL v2.7.x and older releases only. The maintained ProxySQL Core series include 3.0.x, 2.7.x, 2.6.x, 2.5.x, 2.4.x, 2.3.x, and 2.2.x. When installing from a repository, older series require replacing proxysql-3.0.x in the repository URL with proxysql-2.7.x, proxysql-2.6.x, etc. For a generic tarball, set the release version explicitly rather than copying a version from the page. On Debian/Ubuntu, install a specific version with apt-get install proxysql=PROXYSQL_VERSION-ubuntu22. The sample Docker configuration lists settings under mysql_variables, including threads=4 and poll_timeout=2000.

Takeaway: Use the install guidance's version notes when choosing a release series, repository URL, tarball version, or package version.

Set a backend audit session variable

SET @mysql-ldap_user_variable = 'backend_audit_user';
SELECT @mysql-ldap_user_variable AS session_variable;

SET @mysql-ldap_user_variable = 'backend_audit_user' follows the example form for mysql-ldap_user_variable. It sets a session variable with the value you supplied. SELECT @mysql-ldap_user_variable AS session_variable returns that session value. The definition says sessions have a variable with the user_name value when mysql-ldap_user_variable is used.

Try it: config_layer_sim

You need to check whether an audit log change must be loaded. In the variables list, find mysql-auditlog_filename. Confirm its default is blank. Read its definition and note that setting it automatically enables Audit Log. Also note that rotation depends on mysql-auditlog_filesize. Confirm that changes made on this page must be explicitly loaded to the runtime to take effect.

Sources

Do more with an account

Admin Variables and Web Interface Settings — ProxySQL: from first install to production