sqoop基本 操作

列出 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 ' ' -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 ' ' -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


原文地址:https://www.cnblogs.com/brucemengbm/p/7191473.html