Is it possible to intercept and change login information within a lua script for mysql-proxy.
for example, if a user were to hit the proxy like this:
mysql -h localhost -P 4040 -u bob -D orders -p
i would want the connection not only redirected to a backend server, but also the username/database name changed, so that the above command was the equivalent of this:
mysql -h production.server -P 3306 -u bob_production -D bob_orders -p
I notice that it seems that I can only get auth information in the script after the auth has been passed, and even if I could get it before, i don't see a way to easily inject it.
Does anyone have an idea on how this would be possible within mysql-proxy, or with some other solution?