Skip to content
一个用于将binlog转为sql的类
PHP
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
data add params Aug 5, 2017
.gitignore
Binlog.php add params Aug 5, 2017
Conf.php
README.md add params Aug 5, 2017
Util.php
composer.json update Aug 6, 2017
example.php

README.md

介绍

这是一个可以帮助我们把我们的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,或者指定的表。

You can’t perform that action at this time.