首页 > 其他 > 详细

hadoop-sqoop学习笔记

时间:2016-09-14 16:27:27      阅读:103      评论:0      收藏:0      [点我收藏+]


======导入====

sqoop import --connect jdbc:mysql://20.12.20.165:3306/luo0907 --username root --password 12345 --table aa01 --fields-terminated-by ‘\t‘ -m 1 --hive-import

sqoop import --connect jdbc:mysql://20.12.20.165:3306/luo0907 --username root --password 12345 --table aa01 --fields-terminated-by ‘\t‘ -m 1 --hive-import --hive-overwrite --create-hive-table --hive-table luo0908.aa01 --delete-target-dir
sqoop import --connect jdbc:mysql://20.12.20.165:3306/luo0907 --username root --password 12345 --table aa01 --target-dir /luo2/luo01 ###要用hdfs用户执行

GRANT ALL PRIVILEGES ON *.* TO ‘root‘@‘%‘ IDENTIFIED BY ‘12345‘ WITH GRANT OPTION;
hadoop fs -chown root:hdfs /tmp/test.txt

=====导出=====
sqoop export --connect jdbc:mysql://20.12.20.165:3306/luo0907 --username root --password 12345 --table aa01 --export-dir ‘/user/hive/warehouse/luo0908.db/aa01‘ --fields-terminated-by ‘\t‘

hadoop-sqoop学习笔记

原文:http://www.cnblogs.com/luo-mao/p/5872411.html

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