默认的默认级别是 error,因此在命令行启动 maxwell 时候
$ /opt/module/maxwell/bin/maxwell --config /opt/module/maxwell/config.properties
如果出现错误,输出的日志只有错误的最后一句,不便于查找原因,调整 log4j 的输出日志级别:
$ vim log4j2.xml
将
中的 level="error" 改成 "info":
当日志中打印出如下错误:
java.sql.SQLException: null, message from server: "Host '192.168.1.51' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'"
刷新 MySQL 的连接:
$ mysqladmin -uroot -p flush-hosts
如果 MySQL 是 8.x 版本,会报如下错误:
AuthenticationException: Client does not support authentication protocol requested by server; consider upgrading MySQL client
因为 8.x 的认证方式变了,因此要在 MySQL 中将 maxwell 用户的密码加密方式修改下:
mysql> alter user 'maxwell'@'%' identified with mysql_native_password by '123456';
mysql> flush privileges;
如果 MySQL 是 8.x 版本,会报如下连接错误:
The connection property 'zeroDateTimeBehavior' acceptable values are: 'CONVERT_TO_NULL', 'EXCEPTION'
因为 8.x 已经将 convertToNull 改为了 CONVERT_TO_NULL,因此要在 config.properties 配置文件中添加 jdbc_options 配置项:
jdbc_options=zeroDateTimeBehavior=CONVERT_TO_NULL
重启即可
上一篇:STM32的USART发送数据时如何使用TXE和TC标志
下一篇:2.进程和线程