sqoop import \
> --connect jdbc:mysql://192.168.52.150/test \
> --username root \
> --password 123456 \
> --table emp \
> --delete-target-dir \
> --target-dir '/sqoop_works/emp_1'
create database hivesqoop;
use hivesqoop;
create table hivesqoop.emp_add_hive(id int,hon string,street string,city string
)
row format delimited fields terminated by '\t'
stored as orc;
然后导入
sqoop import --connect jdbc:mysql://192.168.52.150/test --username root --password 123456 --table emp_add --hcatalog-database hivesqoop --hcatalog-table emp_add_hive -m 1
将增量数据导入hdfs中
加上 --where id >= 120
hive导出到MySQL 是换个方向。