datax同步数据:数据源mysql,目标源:mysql

一.配置文件


{
    "job": {
        "content": [
            {
              "reader": {
                    "name": "mysqlreader",
                    "parameter": {
                        "column": ["*"],
                        "where":"SD_ID>100",
                        "connection": [
                            {
                                "jdbcUrl": ["jdbc:mysql://172.x.x.x:3306/hive?characterEncoding=utf-8"],
                                "table": ["sds"]
                            }
                        ],
                        "password": "xxxx",
                        "username": "xxxx"
                    }
                },
                "writer": {
                    "name": "mysqlwriter",
                    "parameter": {
                      "column": ["*"],
                        "connection": [
                            {
                                "jdbcUrl": "jdbc:mysql://x.x.x.x:30111/business_data?useUnicode=true&characterEncoding=UTF-8",
                                "table": ["sds"]
                            }
                        ],
                        "password": "xxxx",
                        "username": "xxxxx"
                    }
                }
            }
        ],
        "setting": {
            "speed": {
                "channel": "1"
            }
        }
    }
}

二.运行

datax.py是datax的运行脚本

datax.py start.json

你可能感兴趣的:(datax,mysql,数据库,java)