A tcpcopy module for MySQL session replay
mysql-replay-module is a TCPCopy module that can be used to replay MySQL sessions to support real testing of MySQL applications.
Please refer to TCPCopy for more details before reading the following.
Set route commands to route response packets to the assistant server
For example:
Assume 10.110.12.18 is the IP address of the assistant server and
10.110.12.15 is the MySQL client IP address. We set the following route
command to route all responses to the 10.110.12.15 to the assistant server.
route add -host 10.110.12.15 gw 10.110.12.18
./intercept -F <filter> -i <device,>
Note that the filter format is the same as the pcap filter.
For example:
./intercept -i eth0 -F 'tcp and src port 3306' -d
intercept will capture response packets of the TCP based application which
listens on port 3306 from device eth0
a) set user password pair in conf/plugin.conf in the installion directory
Format:
user user1@password1,user2@password2,...,userN@passwordN;
For example:
user root@123456;
b) start tcpcopy
./tcpcopy -x localServerPort-targetServerIP:targetServerPort -s <intercept server,>
For example(assume 10.110.12.17 is the IP address of the target server):
./tcpcopy -x 3306-10.110.12.17:3306 -s 10.110.12.18
tcpcopy would capture MySQL packets(assume MySQL listens on 3306 port) on current
server, do the necessary modifications and send these packets to the target port
'3306' on '10.110.12.17'(the target MySQL), and connect 10.110.12.18 for asking
intercept to pass response packets to it.
Have a bug or a feature request? Please open a new issue. Before opening any issue, please search for existing issues.
Copyright 2022 under the BSD license.