您的位置:首页 > 运维架构

sqoop基本 操作

2015-08-17 15:06 344 查看
列出 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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: