1》开启binlog模式
先使用docker 创建mysql容器
修改/etc/mysql/mysql.conf.d/mysqld.cnf 开启binlog模式
docker exec -it mysql /bin/bashcd /etc/mysql/mysql.conf.dvi 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;
3》重启mysql容器
docker restart mysql