全量导入:

sqoop import --connect jdbc:mysql://192.168.0.144:3306/db_blog  --username root  --password 123456  --table t_link  --target-dir /user/hadoop/t_link  --hive-import   --create-hive-table   --hive-overwrite   --num-mappers 1 

  

增量导入:(根据时间促来导入,如果表中没有时间促属性,可以增加一列时间簇)

sqoop import --connect jdbc:mysql://192.168.0.144:3306/db_blog  --username root  --password 123456  --table t_link  --target-dir /user/hadoop/t_link  --hive-import   --check-column crt_time  --incremental lastmodified  --last-value "2016-11-22 21:00:00"  --num-mappers 1 

  

 从HIVE中到出道mysql中

sqoop export --connect jdbc:mysql://192.168.0.144:3306/db_blog  --username root  --password 123456  --table test1  --export-dir /user/hive/warehouse/test1  --input-fields-terminated-by '\t'  --num-mappers 1 

  

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-23
  • 2021-05-04
  • 2021-05-23
  • 2021-10-31
  • 2021-04-17
  • 2021-12-01
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-15
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案