将hdfs 中数据导入mysql

sqoop export  --connect jdbc:mysql://10.130.2.245:3306/test 

--update-key "id,name" --update-mode allowinsert  --username dp  --password '123456'  

--table test123  --fields-terminated-by '\t' --columns "id,name,age" --export-dir /hive/warehouse/test123 

1)  -update-key 指定联合主键的值
2)  --update-mode allowinsert 指定更新的模式为可插入,默认为 updateonly

posted on 2017-04-05 20:09  流浪在伯纳乌  阅读(1327)  评论(0编辑  收藏  举报