1.配置
(1)往/etc/profile最后加入
export HADOOP_CLASSPATH=$HADOOP_CLASSPATH:/opt/modules/hive-1.2.1/lib/*
然后刷新配置
source /etc/profile
(2) 把hive-site复制到sqoop中!
cp ../hive-1.2.1/conf/hive-site.xml conf/
2.命令:
bin/sqoop import \
--connect jdbc:mysql://bigdata.ibeifeng.com:3306/sqoop \
--username root \
--password 123456 \
--table tohdfs \
--direct \
--delete-target-dir \
--hive-import \
--hive-database student \
--hive-table stu_info \
--num-mappers 1 \
--fields-terminated-by '\t'