Configuring ProxySQL
Multi-Layer Configuration System
ProxySQL employs three configuration layers:
| Layer | Description |
|---|---|
| RUNTIME | In-memory data structures used by worker threads. Cannot be modified directly. |
| MEMORY | An in-memory database exposed via a MySQL-compatible interface. Contains tables like mysql_servers, mysql_users, and mysql_query_rules. |
| DISK | An 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
| Command | Effect |
|---|---|
LOAD <item> TO RUNTIME | Activates in-memory settings immediately |
LOAD <item> FROM MEMORY | Loads from memory layer to runtime |
SAVE <item> TO DISK | Persists configuration to SQLite |
LOAD <item> FROM CONFIG | Imports 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.