Proxying connection to MySQL without MySQL Proxy

738 views Asked by At

MySQL Proxy sounds like the best option to proxy a connection to MySQL server in order to modify queries online except that it only supports scripts in Lua, AFAIK.

Is it possible to script MySQL Proxy behavior in languages other than Lua? Ideally, C, C++ or C#?

If not, how do I look through and amend the traffic between MySQL client and server (e.g., in C#) without fully implementing the MySQL client/server protocol?

1

There are 1 answers

0
samaitra On BEST ANSWER

Yes, it is possible to build mysql proxy in other languages.

Here are few reference implementations in java

https://github.com/MPjct/JMPjct

https://github.com/Flipkart/phantom-mysql-proxy

To check the traffic between Mysql client and server , you can print the following param.

Com_Query.loadFromPacket(packet).query