nine/binlog2sql

There is no license information available for the latest version (1.0) of this package.

A tool to change binlog to sql

1.0 2017-08-05 15:15 UTC

This package is not auto-updated.

Last update: 2025-04-27 05:21:50 UTC


README

这是一个可以帮助我们把我们的binlog文件的内容转换为可识别的sql语句的工具包。

安装

  1. composer 安装
composer require nine/binlog2sql 
  1. 直接下载 clone 下来即可。

使用

首先在Conf.php中配置自己的MySql信息:

const __DATABASE__ = 'test';
const __TABLE__ = 'student';
const __USER__ = 'root';
const __PASSWORD__ = 123456;
const __HOST__ = '127.0.0.1';
const __PORT__ = 3309;

调用Binlogstart方法:

$binlog = new \Binlog2sql\Binlog();
$binlog->start();

其中start方法可以写入一些参数,比如设置起始时间和起始position,或者指定的表。