注意:填写进 instance.properties 的master ip 是数据库的ip
select SUBSTRING_INDEX(host,':',1) as ip , count(*) from information_schema.processlist group by ip;
1》docker中安装mysql容器
开启binlog模式
修改/etc/mysql/mysql.conf.d/mysqld.cnf
docker exec -it mysql /bin/bash
cd /etc/mysql/mysql.conf.d
vi mysqld.cnf
添加这两行
2》创建用于同步的账号并授权
采用root账号登录
mysql -uroot -p123456
create user canal@'%' IDENTIFIED by 'canal';
GRANT SELECT, REPLICATION SLAVE, REPLICATION CLIENT,SUPER ON *.* TO 'canal'@'%';
FLUSH PRIVILEGES;