Mysql要求
- 修改mysql配置
vim /etc/my.conf
1.[mysqld]
2.log-bin=mysql-bin #添加这一行就ok
3.binlog-format=ROW #选择row模式
4.server_id=1 #配置mysql replaction需要定义,不能和canal的slaveId重复
- 添加canal账户
[root@starrysky ~]# mysql -u root -p
Enter password: 输入密码
1.CREATE USER canal IDENTIFIED BY 'canal';
2.GRANT SELECT, REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'canal'@'%';
3.-- GRANT ALL PRIVILEGES ON *.* TO 'canal'@'%' ;
4.FLUSH PRIVILEGES;
查看权限 show grants for 'canal';
重启mysql: service mysqld restart 或 /etc/inint.d/mysqld restart