环境
已经将mysql jdbc驱动放到sqoop/lib目录
已经将oracle jdbc驱动放到sqoop/lib目录
异常
ERROR sqoop.Sqoop: Got exception running Sqoop: java.lang.RuntimeException: Could not load db driver class: com.mysql.jdbc.Driver
java.lang.RuntimeException: Could not load db driver class: com.mysql.jdbc.Driver
解决
Mysql
export HADOOP_CLASSPATH=/Users/lisiyu/Desktop/softwares/sqoop-1.4.6-hadoop-2/lib/mysql-connector-java-6.0.3.jar
Oracle
export HADOOP_CLASSPATH=/Users/lisiyu/Desktop/softwares/sqoop-1.4.6-hadoop-2/lib/ojdbc6.jar
也可以放到hadoop的env里
vi $HADOOP_HOME/etc/hadoop/hadoop-env.sh
# JDBC Classpath
export HADOOP_CLASSPATH=$HADOOP_CLASSPATH:/Users/lisiyu/Desktop/softwares/sqoop-1.4.6-hadoop-2/lib/mysql-connector-java-6.0.3.jar:/Users/lisiyu/Desktop/softwares/sqoop-1.4.6-hadoop-2/lib/ojdbc6.jar