头歌 Sqoop的安装与配置答案(共一关)

  1. mkdir /app
  2. cd /opt
  3. tar -zxvf sqoop-1.4.7.bin__hadoop-2.6.0.tar.gz -C /app
  4. cd /app
  5. mv sqoop-1.4.7.bin__hadoop-2.6.0/ sqoop

vi /etc/profile     vi操作:i(写入)完成后ESC键 加 :wq  (保存退出)

在末尾添加以下两行代码;

 
  
  1. export SQOOP_HOME=/app/sqoop
  2. export PATH=$PATH:$SQOOP_HOME/bin

source /etc/profile

  1. cd /app/sqoop/conf
  2. mv sqoop-env-template.sh sqoop-env.sh

vi sqoop-env.sh

在末尾添加

  1. export HADOOP_COMMON_HOME=/usr/local/hadoop
  2. export HADOOP_MAPRED_HOME=/usr/local/hadoop
  3. export HIVE_HOME=/hive-2.3.2

  1. cd /opt
  2. tar -zxvf mysql-connector-java-5.1.45.tar.gz
  3. cp mysql-connector-java-5.1.45/mysql-connector-java-5.1.45-bin.jar /app/sqoop/lib/
  1. sqoop list-databases -connect jdbc:mysql://localhost:3306/ --username root --password 123123
  1. sqoop list-databases -connect jdbc:mysql://localhost:3306/ --username root --password 123123 > /app/log.txt

你可能感兴趣的:(sqoop,数据库,mysql)