DataX mysql 同步

脚本任务

{
    "job": {
        "setting": {
            "speed": {
                "channel": 1
            }
        },
        "content": [
            {
                "reader": {
                    "name": "mysqlreader",
                    "parameter": {
                        "username": "root",
                        "password": "****",
                        "column": [
                         "*"
                        ],
                        "splitPk": "id",
                        "connection": [
                            {
                                "table": [
                                    "xxx"
                                ],
                                "jdbcUrl": [
                                    "jdbc:mysql://xxx:3306/xxx?useUnicode=true&characterEncoding=UTF-8&useSSL=false"
                                ]
                            }
                        ]
                    }
                },
                "writer": {
                    "name": "mysqlwriter",
                    "parameter": {
                        "writeMode": "insert",
                        "username": "zhenwu",
                        "password": "Fiber@123456",
                        "column": [
                            "*"
                        ],
                        "session": [
                            "set session sql_mode='STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'"
                        ],
                        "preSql": [
                            "TRUNCATE XXX"
                        ],
                        "connection": [
                            {
                                "jdbcUrl": "jdbc:mysql://XXX:3306/XXX?useUnicode=true&characterEncoding=UTF-8&useSSL=false",
                                "table": [
                                    "XXX"
                                ]
                            }
                        ]
                    }
                }
            }
        ]
    }
}
posted @ 2024-01-11 12:46  vx_guanchaoguo0  阅读(17)  评论(0编辑  收藏  举报