一、配置
1、mv sqoop-env-template.sh sqoop-env.sh
2、sqoop-env.sh添加:
export HADOOP_COMMON_HOME=/opt/module/hadoop-3.1.4
export HADOOP_MAPRED_HOME=/opt/module/hadoop-3.1.4
export HIVE_HOME=/opt/module/hive
export ZOOKEEPER_HOME=/opt/module/zookeeper
export ZOOCFGDIR=/opt/module/zookeeper/conf
3、导入mysql连接驱动包至lib目录下:mysql-connector-java-5.1.48-bin.jar
4、测试连接:
bin/sqoop list-databases --connect jdbc:mysql://hadoop102:3306 --username root --password 123456