Ubuntu16.04 install sqoop-1.4.6.bin__hadoop-2.0.4-alpha.tar.gz

下载  http://mirrors.hust.edu.cn/apache/sqoop/1.4.6/sqoop-1.4.6.bin__hadoop-2.0.4-alpha.tar.gz

 

Sqoop使用import工具导入数据

mysql -uroot -p

show databases;

use hive;

show tables;

show create table TBLS;   //显示用于创建给定表

 

sqoop import --connect jdbc:mysql://localhost/hive --username root --password root --table TBLS -m 1 --target-dir /sqoop --append --fields-terminated-by "\t"

 

Sqoop使用codegen工具生成代码

sqoop codegen --connect jdbc:mysql://localhost/hive --username root --password root --table TBLS --class-name TBLS.java

posted on 2017-10-08 19:46  唐先生_DowneyJr  阅读(238)  评论(0编辑  收藏  举报

导航