标签:地址 use 模板 执行 python3 blog 下载地址 user character
Data是阿里巴巴公司开发的,为解决异构数据源同步问题
它的设计理念:
datax下载地址:https://github.com/alibaba/DataX
由于datax需要python2.x版本,而本机装的是python3.x 所以要安装python2 并且两个版本互不影响
装两个python方法:https://blog.csdn.net/qq_27089287/article/details/79114441
1.查询使用模板
2.使用(以csv到mysql为例)
源码如下:
{ "job": { "setting": { "speed": { "channel": 1 } }, "content": [ { "reader": { "name": "txtfilereader", "parameter": { "path": ["E:/xinfang_data.csv"], "encoding": "gbk", "column": [ { "index": 0, "type": "string" }, { "index": 1, "type": "string" }, { "index": 2, "type": "string" }, { "index": 3, "type": "string" } ], "fieldDelimiter": ",", "skipHeader": "true" } }, "writer": { "name": "mysqlwriter", "parameter": { "writeMode": "insert", "username": "root", "password": "123456", "column": [ "kind", "time", "processingDepartment", "content" ], "session": [], "connection": [ { "jdbcUrl": "jdbc:mysql://127.0.0.1:3306/datax?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=GMT%2B8", "table": ["csv1"] } ] } } } ] } }
执行方法
至此,数据就已经从csv文件导入mysql数据库。
标签:地址 use 模板 执行 python3 blog 下载地址 user character
原文地址:https://www.cnblogs.com/jmdd/p/12389278.html