Giter VIP home page Giter VIP logo

mysql-replay-module's Introduction

A TCPCopy module for MySQL 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.

Installation

Getting intercept installed on the assistant server

  1. git clone git://github.com/session-replay-tools/intercept.git
  2. cd intercept
  3. ./configure --with-resp-payload
  4. make
  5. make install

Getting tcpcopy installed on the online server

  1. git clone git://github.com/session-replay-tools/tcpcopy.git
  2. cd tcpcopy
  3. git clone git://github.com/session-replay-tools/mysql-replay-module.git
  4. ./configure --set-protocol-module=mysql-replay-module
  5. make
  6. make install

Usage guide

1) On the target server which runs MySQL applications:

  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

2) On the assistant server which runs intercept(root privilege or the CAP_NET_RAW capability is required):

   ./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 

3) On the online source server (root privilege or the CAP_NET_RAW capability is required):

  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.

Note

  1. Both MySQL instances on the target server and online server must have the same user accounts and their privileges although passwords could be different
  2. Only the complete sesssion could be replayed

Release History

  • 2017.03 v1.0 mysql-replay-module released

Bugs and feature requests

Have a bug or a feature request? Please open a new issue. Before opening any issue, please search for existing issues.

Copyright and license

Copyright 2014 under the BSD license.

mysql-replay-module's People

Contributors

wangbin579 avatar lazio579 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.