ProxySQL MySQL MySQL · DBA · Operations

ProxySQLUpgrade Guide

Upgrade ProxySQL safely on RHEL/CentOS and Ubuntu. Includes pre-upgrade checklist, zero-downtime cluster upgrade, rollback procedure and post-upgrade verification.

ProxySQL upgrades are generally smooth because configuration is stored in a SQLite database that persists across versions. The upgrade process involves installing the new package and restarting the service — ProxySQL automatically migrates the database schema if needed.

⚠ Warning: Always back up your proxysql.db before upgrading. Test upgrades in staging first.
  1. Read the ProxySQL release notes for your target version
  2. Back up /var/lib/proxysql/proxysql.db
  3. Back up /etc/proxysql.cnf
  4. Note current version: proxysql --version
  5. Test upgrade on staging/dev first
  6. Plan a maintenance window for production
  7. Prepare rollback plan (restore from backup)
BASH — Upgrade (RHEL/CentOS)
# Check current version
proxysql --version

# Back up config
cp /var/lib/proxysql/proxysql.db /backup/proxysql_pre_upgrade_$(date +%Y%m%d).db

# Update repository if needed
yum makecache

# Upgrade ProxySQL
yum update proxysql -y

# Restart service
systemctl restart proxysql

# Verify new version
proxysql --version

# Verify all config intact
mysql -u admin -padmin -h 127.0.0.1 -P 6032   -e "SELECT * FROM mysql_servers; SELECT @@version;"
BASH — Upgrade (Ubuntu/Debian)
# Back up
cp /var/lib/proxysql/proxysql.db /backup/proxysql_pre_upgrade_$(date +%Y%m%d).db

# Update and upgrade
apt-get update
apt-get install proxysql -y

# Restart
systemctl restart proxysql

# Verify
proxysql --version
mysql -u admin -padmin -h 127.0.0.1 -P 6032 -e "SELECT * FROM mysql_servers;"

If you run a ProxySQL cluster, you can upgrade nodes one at a time for zero downtime:

BASH — Zero-Downtime Upgrade
# Step 1: Remove Node 1 from load balancer (stop sending traffic)
# Step 2: Upgrade Node 1
systemctl stop proxysql
yum update proxysql -y
systemctl start proxysql

# Step 3: Verify Node 1 is healthy
mysql -u admin -padmin -h node1 -P 6032 -e "SELECT * FROM runtime_mysql_servers;"

# Step 4: Add Node 1 back to load balancer
# Step 5: Repeat for Node 2, Node 3...

echo "All nodes upgraded with zero downtime"
BASH — Rollback
# If upgrade fails or causes issues:

# Step 1: Stop ProxySQL
systemctl stop proxysql

# Step 2: Install previous version
yum downgrade proxysql-2.x.x -y
# or
apt-get install proxysql=2.x.x -y

# Step 3: Restore database backup
cp /backup/proxysql_pre_upgrade_20260424.db /var/lib/proxysql/proxysql.db
chown proxysql:proxysql /var/lib/proxysql/proxysql.db

# Step 4: Start ProxySQL
systemctl start proxysql

# Step 5: Verify
proxysql --version
mysql -u admin -padmin -h 127.0.0.1 -P 6032 -e "SELECT * FROM mysql_servers;"
SQL — Post-Upgrade Check
-- Connect to Admin and verify everything is working
SELECT @@version;

-- Check all servers are ONLINE
SELECT hostgroup_id, hostname, port, status FROM runtime_mysql_servers;

-- Check users are intact
SELECT username, default_hostgroup, active FROM mysql_users;

-- Check query rules
SELECT rule_id, active, match_pattern, destination_hostgroup FROM mysql_query_rules ORDER BY rule_id;

-- Check stats are flowing
SELECT variable_name, variable_value
FROM stats.stats_mysql_global
WHERE variable_name IN ('Questions','Client_Connections_connected');

-- Run a test query through ProxySQL port 6033
-- mysql -u appuser -pAppPass -h 127.0.0.1 -P 6033 -e "SELECT 1;"