实战 - Spark SQL 整合Hive时,报错找不到mysql驱动

xiaoxiao2021-02-28  100

在Spark SQL整合Hive时,老报错:

The specified datastore driver ("com.mysql.jdbc.Driver") was not found in the CLASSPATH. Please check your CLASSPATH specification, and the name of the driver.

尝试过:

1. 把 $HIVE_HOME/LIB 加入到 /etc/profile 的$CLASSPATH中 , 无法解决; 2. 在 $SPARK_HOME/conf/spark_env.sh 中,使用 export SPARK_CLASSPATH=$SPARK_CLASSPATH:/usr/software/hive-1.2.1/mysql-connector-java-5.1.30-bin.jar , 无法解决; 3. 真是郁闷,直接把 mysql 的驱动程序 放到 $SPARK_HOME/jars ,解决了问题。
转载请注明原文地址: https://www.6miu.com/read-35434.html

最新回复(0)