Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
P

proxysql

> 编程语言
Open source

High-performance proxy for MySQL and PostgreSQL

6.9K stars0 likes0 views
WebsiteGitHub

About

High-performance proxy for MySQL and PostgreSQL

Table of Contents

  • Introduction
  • Useful links
  • Getting started
    • Installation
      • Ubuntu / Debian
      • Red Hat / CentOS
      • Amazon Linux
      • Almalinux
      • OpenSUSE
      • FreeBSD
    • Service management
      • Starting ProxySQL
      • Stopping ProxySQL
      • Restarting ProxySQL
      • Reinitializing ProxySQL
    • Upgrades
    • How to check the ProxySQL version
    • Configuring ProxySQL via the admin interface
      • Configuring ProxySQL through the admin interface
      • Configuring ProxySQL through the config file

Introduction

ProxySQL is a high-performance, high-availability, protocol-aware proxy for MySQL and its forks (such as Percona Server and MariaDB), as well as PostgreSQL. All the while getting the unlimited freedom that comes with a GPL license.

Its development is driven by the lack of open source proxies that provide high performance.

Useful links ===============

  • Official website
  • Subscriptions and Support
  • Documentation
  • DockerHub Repository
  • Benchmarks and blog posts
  • Forum
  • Facebook
  • Linkedin
  • Twitter

Getting started

Installation

Released packages can be found here: https://github.com/sysown/proxysql/releases

Just download a package and use your systems package manager to install it:

bash
wget https://github.com/sysown/proxysql/releases/download/v3.0.4/proxysql_3.0.4-ubuntu24_amd64.deb
dpkg -i proxysql_3.0.4-ubuntu24_amd64.deb

Generic Linux binaries (tarball)

Distribution-agnostic .tar.gz builds are also published on the releases page — handy for hosts where a .deb/.rpm is inconvenient (any glibc 2.34+ Linux, amd64 or arm64). ProxySQL embeds the pinned OpenSSL 3.5.7 libraries and does not need host OpenSSL shared libraries; GnuTLS remains a dynamic runtime dependency. This vendoring is not a FIPS compliance claim—future FIPS module support is tracked separately in issue #6116. Grab the proxysql-<version>-linux-<arch>.tar.gz asset, verify its checksum, and extract:

bash
sha256sum -c proxysql-<version>-linux-amd64.tar.gz.sha256
tar xzf proxysql-<version>-linux-amd64.tar.gz

The archive contains bin/proxysql, a sample etc/proxysql.cnf, the systemd/ units, and helper tools. The v4.0 build additionally includes runtime plugins for MySQL X, GenAI, and the real MySQL Router compatibility foundation. The Router plugin is distinct from the MySQL X protocol plugin and is not yet included in release packages; source builds install proxysql_mysql_router.so under /usr/lib/proxysql/plugins/.

Building ProxySQL from source requires Git LFS so the pinned OpenSSL source is hydrated before dependency builds start:

bash
git lfs install
git lfs pull --include=deps/libssl/openssl-3.5.7.tar.gz
deps/libssl/verify-source.bash

See the vendored OpenSSL maintenance guide for source verification, recovery, and the supported patch-update procedure from issue #6115.

Alternatively you can also use the available repositories:

Ubuntu / Debian:

Adding repository:

bash
apt-get update && apt-get install -y --no-install-recommends lsb-release wget apt-transport-https ca-certificates
wget -nv -O /etc/apt/trusted.gpg.d/proxysql-3.0.x-keyring.gpg 'https://repo.proxysql.com/ProxySQL/proxysql-3.0.x/repo_pub_key.gpg'
echo "deb https://repo.proxysql.com/ProxySQL/proxysql-3.0.x/$(lsb_release -sc)/ ./" | tee /etc/apt/sources.list.d/proxysql.list

Installing:

bash
apt-get update
apt-get install proxysql OR apt-get install proxysql=version

Red Hat / CentOS:

Adding repository:

bash
cat > /etc/yum.repos.d/proxysql.repo << EOF
[proxysql]
name=ProxySQL YUM repository
baseurl=https://repo.proxysql.com/ProxySQL/proxysql-3.0.x/centos/\$releasever
gpgcheck=1
gpgkey=https://repo.proxysql.com/ProxySQL/proxysql-3.0.x/repo_pub_key
EOF

Installing:

bash
yum install proxysql OR yum install proxysql-version

Amazon Linux:

Adding repository:

bash
cat > /etc/yum.repos.d/proxysql.repo << EOF
[proxysql]
name=ProxySQL YUM repository
baseurl=https://repo.proxysql.com/ProxySQL/proxysql-3.0.x/centos/8
gpgcheck=1
gpgkey=https://repo.proxysql.com/ProxySQL/proxysql-3.0.x/repo_pub_key
EOF

Installing:

bash
yum install proxysql OR yum install proxysql-version

Almalinux:

Adding repository:

bash
cat > /etc/yum.repos.d/proxysql.repo << EOF
[proxysql]
name=ProxySQL YUM repository
baseurl=https://repo.proxysql.com/ProxySQL/proxysql-3.0.x/almalinux/\$releasever
gpgcheck=1
gpgkey=https://repo.proxysql.com/ProxySQL/proxysql-3.0.x/repo_pub_key
EOF

Installing:

bash
yum install proxysql OR yum install proxysql-version

OpenSUSE:

Adding repository:

bash
cat > /etc/zypp/repos.d/proxysql.repo << EOF
[proxysql]
name=ProxySQL Zypper repository
enabled=1
autorefresh=0
baseurl=https://repo.proxysql.com/ProxySQL/proxysql-3.0.x/opensuse/\$releasever_major
gpgcheck=1
EOF

or

bash
zypper addrepo -g -n 'ProxySQL Zypper repository' 'https://repo.proxysql.com/ProxySQL/proxysql-3.0.x/opensuse/$releasever_major' proxysql

Installing:

bash
yum install proxysql OR yum install proxysql-version

FreeBSD:

Installing (via pkg):

bash
pkg install proxysql

Installing (via ports):

bash
cd /usr/ports/databases/proxysql/ && make install clean

Service management

Once the software is installed, you can use the service command to control the process:

Starting ProxySQL:

bash
service proxysql start

Stopping ProxySQL:

bash
service proxysql stop

Or alternatively via the Admin interface (MySQL admin example):

$ mysql -u admin -padmin -h 127.0.0.1 -P6032 --prompt='Admin> '
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.5.30 (ProxySQL Admin Module)

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

Admin> proxysql stop

For PostgreSQL admin interface the same Admin commands apply and the admin port defaults to 6132. You can connect using the psql client as follows:

$ export PGPASSWORD=admin
$ psql -U admin -h 127.0.0.1 -p6132
psql (17.4 (Ubuntu 17.4-1.pgdg22.04+2), server 16.1)
SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, compression: off, ALPN: none)
Type "help" for help.

admin=# proxysql stop

(The examples above show the Admin interface workflow - the Admin SQL commands are the same for both MySQL and PostgreSQL modes.)

Restarting ProxySQL:

bash
service proxysql restart

Or alternatively via the Admin interface (MySQL example):

$ mysql -u admin -padmin -h 127.0.0.1 -P6032 --prompt='Admin> '
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.5.30 (ProxySQL Admin Module)

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

Admin> proxysql restart

Or via the PostgreSQL admin port:

$ export PGPASSWORD=admin
$ psql -U admin -h 127.0.0.1 -p6132
psql (17.4 (Ubuntu 17.4-1.pgdg22.04+2), server 16.1)
SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, compression: off, ALPN: none)
Type "help" for help.

admin=# proxysql restart

Reinitializing ProxySQL from the config file (after first startup the DB file is used instead of the config file):

bash
# If you are using the init script run:
/etc/init.d/proxysql initial
# or
service proxysql initial
 
# If you are using the systemd unit file run:
systemctl start proxysql-initial
# or
service proxysql-initial start

Upgrades

Just install the new package and restart ProxySQL:

bash
wget https://github.com/sysown/proxysql/releases/download/v3.0.4/proxysql_3.0.4-ubuntu24_amd64.deb
dpkg -i proxysql_3.0.4-ubuntu24_amd64.deb
service proxysql restart

How to check the ProxySQL version

bash
$ proxysql --version
bash
ProxySQL version 3.0.4-162-gfaa64a5, codename Truls

A debug version has _DEBUG in its version string. It is slower than non-debug version, but easier to debug in case of failures.

bash
$ proxysql --version
bash
ProxySQL version 3.0.4-162-gfaa64a5_DEBUG, codename Truls

Configuring ProxySQL via the admin interface

First of all, bear in mind that the best way to configure ProxySQL is through its admin interface. This lends itself to online configuration (without having to restart the proxy) via SQL queries to its admin database. It's an effective way to configure it both manually and in an automated fashion.

As a secondary way to configure it, we have the configuration file.

Configuring ProxySQL through the admin interface

To log into the admin interface for MySQL (with the default credentials) use a mysql client and connect using the following admin credentials locally on port (6032):

bash
$ mysql -u admin -padmin -h 127.0.0.1 -P6032 --prompt='Admin> '
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.5.30 (ProxySQL Admin Module)

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

Admin>

note: If your MySQL client version is version 8.04 or higher add --default-auth=mysql_native_password to the above command to connect to the admin interface.

To log into the admin interface for PostgreSQL use the psql client and connect using admin on port 6132 (the Admin SQL commands are the same):

bash
$ export PGPASSWORD=admin
$ psql -U admin -h 127.0.0.1 -p6132
psql (17.4 (Ubuntu 17.4-1.pgdg22.04+2), server 16.1)
SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, compression: off, ALPN: none)
Type "help" for help.

admin=#

Once connected to the admin interface, you will have a list of databases and tables at your disposal that can be queried using the SQL language:

mysql
Admin> SHOW DATABASES;
+-----+---------+-------------------------------+
| seq | name

Issues· 1086 open

View all issuesOpen on GitHub
  • #6216

    Connect timeout after ProxySQL start, during storm of backend connections (3.x only, not reproducible on 2.x)

    Updated Sep 22, 2026
  • #6208

    TAP build and isolated test infra fail on arm64 build containers and macOS hosts

    Updated Sep 17, 2026
  • #6203

    test(pgsql): regression test for poisoned-transaction recovery with JSON event logging (#6084)

    Updated Sep 17, 2026
  • #6197

    PostgreSQL Prepared Statement Collision with ProxySQL 3.0.8

    Updated Sep 17, 2026
  • #6200

    docker-base: stop hardcoding orchestrator-client amd64.deb

    Updated Sep 17, 2026
  • #5851

    Pre-2018 open issues triage and cleanup

    documentationUpdated Sep 13, 2026
  • #6138

    ProxySQL's PostgreSQL module rejects `Bind` messages that request **mixed per-column result formats** (some result columns text, some binary) with:

    Updated Sep 13, 2026
  • #6193

    [DOCS/ENHANCEMENT] Clarify runtime_mysql_users desynchronization recovery & atomic purge flow during client handshake errors

    Updated Sep 11, 2026
  • #6187

    Aurora monitor can remain permanently blind after a failover when use_ssl=1

    Updated Sep 9, 2026
  • #2908

    Too many CLOSE_WAIT connections to backend mysql servers

    Updated Sep 4, 2026

> Tags

C++

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 23, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言