# MySQL Server sees the ProxySQL IP and not the ClientsIP

**URL:** <https://forums.percona.com/t/mysql-server-sees-the-proxysql-ip-and-not-the-clientsip/39091>\
**Category:** ProxySQL\
**Created:** [August 12, 2025, 1:08pm UTC](https://forums.percona.com/t/mysql-server-sees-the-proxysql-ip-and-not-the-clientsip/39091 "2025-08-12T13:08:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lbmdkap](https://avatars.discourse-cdn.com/v4/letter/l/c37758/32.png) [@lbmdkap](https://forums.percona.com/u/lbmdkap)\
**Post date:** [August 12, 2025, 1:08pm UTC](https://forums.percona.com/t/mysql-server-sees-the-proxysql-ip-and-not-the-clientsip/39091/1 "2025-08-12T13:08:49Z")

</div>

As part of our POC we have ran into an “small” issue, where the MySQL (percona) server sees the IP of the ProxySQL node instead of the clientsIP, which then ofc result in access denied.

We have an LB in front of the ProxySQL, so the connection, looks like this.

MySQLClient→ LB→ProxySQL→MySQLNode(Percona)

Actually the issue is the same if I connect to the ProxySQL IP directly.  
MySQLClient→ ProxySQL→MySQLNode(Percona)

What am I missing ?  
For MySQL i’ve been looking at “proxy\_protocol\_networks” and for ProxySQL mysql-proxy\_protocol\_networks, but im not 100% sure this is what I want?

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [August 12, 2025, 2:41pm UTC](https://forums.percona.com/t/mysql-server-sees-the-proxysql-ip-and-not-the-clientsip/39091/2 "2025-08-12T14:41:17Z")

</div>

> [@lbmdkap](#):
>
> where the MySQL (percona) server sees the IP of the ProxySQL node instead of the clientsIP

This is 100% correct, and expected. ProxySQL does not “forward” connections to backend MySQL servers. ProxySQL creates completely new connections, thus you will not see the client IP, you will see the IP of ProxySQL. Client connections connect to ProxySQL and the connection terminates there. A new, separate, connection is opened by ProxySQL to MySQL, and the queries from client are sent over this connection. This has always been the behavior of ProxySQL, and as far as I know, there is no way around this because ProxySQL can use that single backend connection to multiplex many different fronend clients.

---

<div class="post-metadata">

**Author:** ![lbmdkap](https://avatars.discourse-cdn.com/v4/letter/l/c37758/32.png) [@lbmdkap](https://forums.percona.com/u/lbmdkap)\
**Post date:** [August 15, 2025, 9:21am UTC](https://forums.percona.com/t/mysql-server-sees-the-proxysql-ip-and-not-the-clientsip/39091/3 "2025-08-15T09:21:38Z")

</div>

Ok, I found this rather old thread, and it seems this will never be done. But a lot could have changed in the last ~ 6 years

> <https://github.com/sysown/proxysql/issues/1791>
>
> There exists a problem: when use proxysql, we could not get the real client ip f…rom the backend mysql's connection lists(such as processlist, slow\_log, general\_log),actually all the connections's hostname or ip informations get through the proxysql node are replaced by the proxysql itself. And this problem make it difficult to diagnose performance issues when we need to location the real client hostname or ip information from which poor sql statements send, e.t.c
> 
> Could proxysql support the transparent proxy feature, which could retain the real client ip when proxysql retransmit the query to the mysql backend.
> 
> PS: \[Transparent proxy support\](https://www.kernel.org/doc/Documentation/networking/tproxy.txt)
