Connecting to the Admin Interface
ProxySQL has a built-in Admin interface that listens on port 6032. You manage ProxySQL entirely through this interface using standard MySQL client with SQL commands.
BASH — Connect to Admin
# Connect using MySQL client
mysql -u admin -padmin -h 127.0.0.1 -P 6032 --prompt="ProxySQL> "
# Or using shorter form
mysql -u admin -padmin -h 127.0.0.1 -P 6032
Admin Databases
Once connected, ProxySQL exposes several internal databases:
SQL — Show Databases
-- Show all databases
SHOW DATABASES;
-- Result:
-- +-----+---------------+-------------------------------------+
-- | seq | name | file |
-- +-----+---------------+-------------------------------------+
-- | 0 | main | |
-- | 2 | disk | /var/lib/proxysql/proxysql.db |
-- | 3 | stats | |
-- | 4 | monitor | |
-- | 5 | stats_history | |
-- +-----+---------------+-------------------------------------+
| Database | Purpose |
|---|---|
| main | In-memory config (staging area — what you edit) |
| disk | Persistent SQLite config (survives restart) |
| stats | Runtime statistics — query counts, pool stats, etc. |
| monitor | Health check results for backend MySQL servers |
| stats_history | Historical statistics data |
Key Admin Tables
SQL — Show Tables
-- Show all tables in main database
USE main;
SHOW TABLES;
| Table | Purpose |
|---|---|
| mysql_servers | Backend MySQL servers list |
| mysql_users | MySQL users ProxySQL authenticates |
| mysql_query_rules | Query routing rules |
| mysql_replication_hostgroups | Read/Write hostgroup mapping |
| mysql_group_replication_hostgroups | Group Replication hostgroup mapping |
| global_variables | ProxySQL global settings |
| mysql_collations | Supported MySQL collations |
| proxysql_servers | ProxySQL cluster nodes |
Changing Admin Credentials
SQL — Change Admin Password
-- Change admin password (do this immediately in production)
UPDATE global_variables
SET variable_value = 'admin:StrongPassword123!'
WHERE variable_name = 'admin-admin_credentials';
-- Apply and save
LOAD ADMIN VARIABLES TO RUNTIME;
SAVE ADMIN VARIABLES TO DISK;
The Load / Save Pattern
Every change in ProxySQL follows this two-step pattern to activate and persist:
SQL — Load & Save Commands
-- After changing MySQL servers:
LOAD MYSQL SERVERS TO RUNTIME;
SAVE MYSQL SERVERS TO DISK;
-- After changing MySQL users:
LOAD MYSQL USERS TO RUNTIME;
SAVE MYSQL USERS TO DISK;
-- After changing query rules:
LOAD MYSQL QUERY RULES TO RUNTIME;
SAVE MYSQL QUERY RULES TO DISK;
-- After changing global variables:
LOAD MYSQL VARIABLES TO RUNTIME;
SAVE MYSQL VARIABLES TO DISK;
-- After changing admin variables:
LOAD ADMIN VARIABLES TO RUNTIME;
SAVE ADMIN VARIABLES TO DISK;
💡 Note: LOAD applies changes immediately to the running ProxySQL process. SAVE persists them to the SQLite disk database so they survive a restart.
Viewing Current Configuration
SQL — View Config
-- View all global variables
SELECT * FROM global_variables;
-- View MySQL servers
SELECT * FROM mysql_servers;
-- View MySQL users
SELECT * FROM mysql_users;
-- View query rules
SELECT * FROM mysql_query_rules;
-- View runtime servers (what is actually active)
SELECT * FROM runtime_mysql_servers;
-- View runtime query rules
SELECT * FROM runtime_mysql_query_rules;
Useful Admin Commands
SQL — Admin Commands
-- Show ProxySQL version
SELECT @@version;
-- Show uptime and stats
SHOW PROCESSLIST;
-- Reset all statistics counters
SELECT * FROM stats.stats_mysql_global;
-- Flush logs
PROXYSQL FLUSH LOGS;
-- Restart ProxySQL internals without full restart
PROXYSQL RESTART;
-- Full shutdown
PROXYSQL SHUTDOWN;