DATAX避坑点——MySQL到MYSQL,某个垃圾教程(简书)中,误导新手

如果出现不能连接MYSQL时,可以从以下三点考虑

1,不要用local host!!!!!千万不要用,要用127.0.0.1就可以了

2,换mysql-connector包

换掉

datax->plugins->reader->mysqlreader->libs->mysql-connector-5...的jar包换成8.0的版本

datax->plugins->write->mysqlwriter->libs->coonector-5...的jar包换成8.0的版本

3,那就是json文件格式出问题了

  1 {
  2 
  3     "job": {
  4 
  5         "setting": {
  6 
  7             "speed": {
  8 
  9                  "channel": 3
 10 
 11             },
 12 
 13             "errorLimit": {
 14 
 15                 "record": 0,
 16 
 17                 "percentage": 0.02
 18 
 19             }
 20 
 21         },
 22 
 23         "content": [
 24 
 25             {
 26 
 27                 "reader": {
 28 
 29                     "name": "mysqlreader",
 30 
 31                     "parameter": {
 32 
 33                         "username": "root",
 34 
 35                         "password": "zb753951",
 36 
 37                         "column": [
 38 
 39                             "id",
 40 
 41                             "name"
 42 
 43  
 44 
 45                         ],
 46 
 47                         "connection": [
 48 
 49                             {
 50 
 51                                 "table": ["test1"],
 52 
 53                                 "jdbcUrl": ["jdbc:mysql://127.0.0.1:3306/datax?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=GMT%2B8"]
 54 
 55                             }
 56 
 57                         ]
 58 
 59                     }
 60 
 61                 },
 62 
 63                "writer": {
 64 
 65                     "name": "mysqlwriter",
 66 
 67                     "parameter": {
 68 
 69                         "writeMode": "insert",
 70 
 71                         "username": "root",
 72 
 73                         "password": "zb753951",
 74 
 75                         "column": [
 76 
 77                             "id",
 78 
 79                             "name"
 80 
 81                         ],
 82 
 83                         "session": [],
 84 
 85                         "connection": [
 86 
 87                             {
 88 
 89                                 "jdbcUrl": "jdbc:mysql://127.0.0.1:3306/datax?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=GMT%2B8",
 90 
 91                                 "table": ["test2"]
 92 
 93                             }
 94 
 95                         ]
 96 
 97                     }
 98 
 99                 }
100 
101             }
102 
103         ]
104 
105     }
106 
107 }

 

上一篇:DATAX 从scv到csv 从csv到mysql


下一篇:执行 dataX 数据同步命令