首页 > 其他 > 详细

sqoop基本 操作

时间:2017-07-16 19:47:12      阅读:260      评论:0      收藏:0      [点我收藏+]

列出 hive的 全部库 

sqoop list-databases --connect jdbc:mysql://localhost --username hive --password hive

列出全部的表 

sqoop list-tables --connect jdbc:mysql://localhost/hive_metadata --username hive --password hive 

mysql导入到hdfs中 

sqoop import -connect jdbc:mysql://10.0.2.139:3306/db -username root -password 123456 -table tb_name -fields-terminated-by ‘\t‘ -m 1

将 hdfs导入到mysql中 

sqoop export --connect jdbc:mysql://localhost:3306/hive_metadata --username hive --password hive --table f2b_admins --export-dir ‘/user/root/f2b_admins/part-m-00000‘ --fields-terminated-by ‘\t‘ -m 1 

从mysql导入到hbase中

sqoop import -connect jdbc:mysql://10.0.2.139:3306/f2b -username root -password suibianba --table f2b_admins --hbase-create-table --hbase-table f2b_admin --column-family info --hbase-row-key id -m 1


sqoop基本 操作

原文:http://www.cnblogs.com/brucemengbm/p/7191473.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!