1、下载解压
http://maxwells-daemon.io/quickstart/
2、修改MySQL服务器配置
$ vi my.cnf [mysqld] server_id=1 log-bin=master binlog_format=row
3、创建账号给maxwell使用
mysql> CREATE USER 'maxwell'@'%' IDENTIFIED BY '123456';
mysql> GRANT ALL ON maxwell.* TO 'maxwell'@'%';mysql> GRANT SELECT, REPLICATION CLIENT, REPLICATION SLAVE ON . TO 'maxwell'@'%';
4、启动监听并输出到终端
bin/maxwell --user='maxwell' --password='123456' --host='127.0.0.1' --producer=stdout
也可以将配置写入配置文件
$ cat config.properties
log_level=info
producer=stdout
host=localhost
user=maxwell
password=123456
$ bin/maxwell --config config.properties
5、输出数据
</div>