Identify user by proxysql host

Good morning how are you?
We are testing ProxySQL and we are at an impasse.
We have several users with their names repeated, differing only by the origin host, we would like that when a user accesses the database and goes through proxysql, the proxysql makes the balance and informs the database the user’s origin host.

In the test, proxysql reports only the proxysql host itself, ignoring the user’s source host.

Is there a way this can be done?

1 Like

Correct. There is no workaround for this as it is not a bug. Applications make connections to ProxySQL believing it is MySQL. ProxySQL makes separate, independent connections, acting as a client, to backend MySQL servers.

2 Likes

Hi thanks for the help.

I’m in doubt about how the Audit would be done using Percona’s ProxySQL?
Example: How to know that a specific user, at a given time (Date/Time), made a writing or reading command to the database? since in the mysql database you will see that the proxysql user will be doing both writing and reading commands.

1 Like

Because I would like to identify or audit what users do to the database, as each user machine has a fresh installation connected to the database, how can we do this with the proxy? To some monitoring that I can at least identify the host of origin of the command?

1 Like

That is incorrect. There is no “proxysql user”. ProxySQL will use the same username/password that your application uses to establish back-end connections. This is why the mysql_users table in proxysql’s config exists. You must add all application accounts to proxysql for this purpose. Your audit logs will still show username/date/time, but the source IP will always be proxysql.

2 Likes