Skip to main content

Configuring ProxySQL

Multi-Layer Configuration System

ProxySQL employs three configuration layers:

LayerDescription
RUNTIMEIn-memory data structures used by worker threads. Cannot be modified directly.
MEMORYAn in-memory database exposed via a MySQL-compatible interface. Contains tables like mysql_servers, mysql_users, and mysql_query_rules.
DISKAn SQLite3 database (default: /var/lib/proxysql/proxysql.db) that persists configuration across restarts.

Configuration Lifecycle

During startup, ProxySQL prioritises the on-disk database over the configuration file. If the database exists, the config file is ignored unless the --initial or --reload flags are used.

Moving Configuration Between Layers

CommandEffect
LOAD <item> TO RUNTIMEActivates in-memory settings immediately
LOAD <item> FROM MEMORYLoads from memory layer to runtime
SAVE <item> TO DISKPersists configuration to SQLite
LOAD <item> FROM CONFIGImports settings from the configuration file
caution

Changes will not be activated until they are loaded to RUNTIME. Any changes not saved to DISK will be lost after a ProxySQL restart.

Validation only occurs during runtime loads; invalid settings may be silently reverted.

See Also