阿里DataX支持mysql8.X 改造记录

1、从mysql8 往elasticsearch 7导入数据时,报错。

 

 

2、经查询,官方datax仅支持my5.x,以下为改造适配mysql 8.x 资料记录。

DataX支持mysql8.X
https://blog.csdn.net/qq_41852045/article/details/108485749
https://blog.csdn.net/qq_42502354/article/details/108824761
https://blog.csdn.net/qq_38115310/article/details/108662659      Datax mysql8插件开发
https://blog.csdn.net/Loiterer_Y/article/details/115692010
https://blog.csdn.net/jason_9527/article/details/100995505

https://www.cnblogs.com/shuyao268/p/14879486.html
https://www.cnblogs.com/harvey2017/p/12148090.html
https://www.cnblogs.com/zifan/p/12550747.html

https://rxf113.xyz/DataX%E5%AE%9E%E8%B7%B5/                   
https://www.jianshu.com/p/997727d488e6
http://www.manongjc.com/detail/14-iexdburliccybhe.html
https://www.gitmemory.com/issue/alibaba/DataX/146/826093789
https://www.zybuluo.com/Catyee/note/1790630
https://github.com/alibaba/DataX/issues/677
https://github.com/alibaba/DataX/issues/1062
https://github.com/alibaba/DataX/issues/172
https://github.com/alibaba/DataX/issues/146

全文替换 convertToNull 为 CONVERT_TO_NULL;
zeroDateTimeBehavior的值convertToNull 为 CONVERT_TO_NULL:
​ 全文替换"com.mysql.jdbc.Driver""com.mysql.cj.jdbc.Driver",

用maven重新编辑构建发布
mvn -U clean package assembly:assembly -Dmaven.test.skip=true

其中mysqlwriter 中:
"jdbcUrl": "jdbc:mysql://192.125.30.169:3306/wjybjy?useUnicode=true&characterEncoding=gbk&useSSL=false&serverTimezone=UTC",
比如:python datax.py file.json , 则file.json的配置项:
"jdbcUrl":"jdbc:mysql://${writer_gateway}/oms?useUnicode=true&characterEncoding=UTF-8&useSSL=false",
第五步jdbc链接追加useSSL=false设置:
比如:python datax.py file.json , 则file.json的配置项:
"jdbcUrl":"jdbc:mysql://${writer_gateway}/oms?useUnicode=true&characterEncoding=UTF-8&useSSL=false",
"jdbcUrl": "jdbc:mysql://192.125.30.169:3306/wjybjy?useUnicode=true&characterEncoding=gbk&useSSL=false&serverTimezone=UTC",

需要注意的几点:1.writer中不能带[]; reader中必须带[]。
2.需要加&useSSL=false&serverTimezone=UTC"
3."setting": {
"speed": {
"channel": 1
}
},

 

posted @ 2021-09-08 14:09  DarJeely  阅读(586)  评论(0编辑  收藏  举报