canal用的版本是 v1.1.4
mysql 和 canal全部都是用docker启动, 是用docker-compose 管理
mysql my.cnf
[mysqld]
server_id=1
log-bin=mysql-bin # 开启 binlog
binlog-format=ROW # 选择 ROW 模式
[mysql]
default-character-set=utf8
instance.properties配置
canal.instance.master.address="mysql:3306"
canal.instance.master.journal.name=
canal.instance.master.position=
canal.instance.master.timestamp=
canal.instance.master.gtid=
canal.instance.dbUsername=root
canal.instance.dbPassword=
canal.instance.connectionCharset = UTF-8
canal.instance.defaultDatabaseName =test #默认的数据库名
canal-adapter能正常连接mysql
canal-server报错信息
2019-09-27 12:50:26.443 [destination = example , address = mysql/172.23.0.2:3306 , EventParser] ERROR com.alibaba.otter.canal.common.alarm.LogAlarmHandler - destination:example[com.alibaba.otter.canal.parse.exception.CanalParseException: java.io.IOException: connect mysql/172.23.0.2:3306 failure
Caused by: java.io.IOException: connect mysql/172.23.0.2:3306 failure
at com.alibaba.otter.canal.parse.driver.mysql.MysqlConnector.connect(MysqlConnector.java:83)
at com.alibaba.otter.canal.parse.inbound.mysql.MysqlConnection.connect(MysqlConnection.java:89)
at com.alibaba.otter.canal.parse.inbound.mysql.MysqlEventParser.preDump(MysqlEventParser.java:86)
at com.alibaba.otter.canal.parse.inbound.AbstractEventParser$3.run(AbstractEventParser.java:183)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.io.IOException: Error When doing Client Authentication:ErrorPacket [errorNumber=1045, fieldCount=-1, message=Access denied for user 'root'@'172.23.0.4' (using password: YES), sqlState=28000, sqlStateMarker=#]
at com.alibaba.otter.canal.parse.driver.mysql.MysqlConnector.negotiate(MysqlConnector.java:271)
at com.alibaba.otter.canal.parse.driver.mysql.MysqlConnector.connect(MysqlConnector.java:80)
... 4 more
mysql 报错信息
mysql_1 | 2019-09-27T04:45:49.583225Z 35 [Note] Access denied for user 'root'@'172.23.0.4' (using password: YES)
mysql_1 | 2019-09-27T04:45:59.259234Z 33 [Warning] 'user' entry 'root@localhost' ignored in --skip-name-resolve mode.
mysql_1 | 2019-09-27T04:45:59.259306Z 33 [Warning] 'user' entry 'mysql.sys@localhost' ignored in --skip-name-resolve mode.
mysql_1 | 2019-09-27T04:45:59.260076Z 33 [Warning] 'db' entry 'sys mysql.sys@localhost' ignored in --skip-name-resolve mode.
mysql_1 | 2019-09-27T04:45:59.260598Z 33 [Warning] 'proxies_priv' entry '@ root@localhost' ignored in --skip-name-resolve mode.
mysql_1 | 2019-09-27T04:45:59.261075Z 33 [Warning] 'tables_priv' entry 'sys_config mysql.sys@localhost' ignored in --skip-name-resolve mode.
mysql_1 | 2019-09-27T04:46:01.095476Z 36 [Note] Access denied for user 'root'@'172.23.0.4' (using password: YES)
mysql_1 | 2019-09-27T04:46:12.848317Z 37 [Note] Access denied for user 'root'@'172.23.0.4' (using password: YES)
mysql_1 | 2019-09-27T04:46:24.050283Z 38 [Note] Access denied for user 'root'@'172.23.0.4' (using password: YES)
有哪位老哥遇到这种情况呢。