Giter VIP home page Giter VIP logo

mysql-binlog-events's Introduction

The MySQL Binlog Events Library is a C++ library for reading MySQL replication events, either by connecting to a server or by reading from a file. To handle reading from a server, it includes a very simple client.

Dependencies

You need to have CMake version 2.8 or later and MySQL-5.7.x .

Now to get the libmysqlclient and the necessary include files you will have to do this:

  1. Download the source code of mysql-5.7.x (http://dev.mysql.com/downloads/mysql/) from the tab Development Releases.

  2. Download the binaries of the same version. There are few header files which are needed for mysql-binlog compilation and they only come as part of the source file. To make these files available during compilation please set the environment variable MYSQL_SOURCE_INCLUDE_DIR=<mysql-5.7.x source code>/include.

To be able to run the unit tests, you have to have Google Test installed. Google Test will be automatically installed if cmake is called as:

cmake . -DENABLE_DOWNLOADS=1

Directory structure

.
|-- bindings            Files for transport
|   |-- include         Include files
|   |-- src             Source files for library
|-- examples            Examples
|   |-- binlog-browser  Example application to browse the binary log
|-- libbinlogevents     Files to decode binlog events
|   |-- include         Include files
|   |-- src             Source files for library
|-- tests               Unit test files and directories

Building

To build the entire package, it is first necessary to run CMake to build all the makefiles. Before running CMake set this environment variable MYSQL_DIR to point to the MySQL binaries and then you can figure out where to find the right files in the cmake code.

We are using the statically linked version of libmysqlclient, so we need to pass -DMYSQLCLIENT_STATIC_LINKING:BOOL=TRUE along with the cmake command

    export MYSQL_DIR=<path of mysql directory or libmysql>
    cmake . -DMYSQLCLIENT_STATIC_LINKING:BOOL=TRUE
    make -j4

Some of the examples are using third-party software, which can require extra parameters to be given to CMake.

If you want to perform an out-of-source build, you can just create a build directory and execute CMake there.

  mkdir build
  cd build
  cmake <source directory>
  make -j4

About Value Convert

Any value that not implement yet in mysql-binlog-events/bindings/src/value.cpp, you can look in mysql-source-code/sql/log_event.cc and find function log_event_print_value.

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.