ProxySQL MySQL MySQL · DBA · Configuration

ProxySQLAdmin Interface

Master the ProxySQL Admin interface on port 6032. Learn all admin databases, tables, Load/Save patterns, and essential admin commands.

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

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 |                                     |
-- +-----+---------------+-------------------------------------+
DatabasePurpose
mainIn-memory config (staging area — what you edit)
diskPersistent SQLite config (survives restart)
statsRuntime statistics — query counts, pool stats, etc.
monitorHealth check results for backend MySQL servers
stats_historyHistorical statistics data
SQL — Show Tables
-- Show all tables in main database
USE main;
SHOW TABLES;
TablePurpose
mysql_serversBackend MySQL servers list
mysql_usersMySQL users ProxySQL authenticates
mysql_query_rulesQuery routing rules
mysql_replication_hostgroupsRead/Write hostgroup mapping
mysql_group_replication_hostgroupsGroup Replication hostgroup mapping
global_variablesProxySQL global settings
mysql_collationsSupported MySQL collations
proxysql_serversProxySQL cluster nodes
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;

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.
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;
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;