赞
踩
sqoop import
--connect jdbc:mysql://192.168.66.4:3306/networkmanagement \
--username sendi \
--password 1234 \
--table people \
--columns "name,age" \
--where "age>18" \
--target-dir hdfsPeople \
--delete-target-dir \
-m 1
1、首先先在MySQL中创建表
2、重复的记录要删除
2、export path 指定导出的目录
4、–updata-key
#### 在 mysql 下创建表
create table customertest(id int,name varchar(20),last_mod timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
sqoop import
--connect jdbc:mysql://192.168.66.4:3306/networkmanagement?useUnicode=true&characterEncoding=utf-8" \
--username sendi \
--password 1234 \
--table people \
--columns "id,name" \
--input-fields-terminated-by ',' \
--export-dir path \
-m 1
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。