SPARK 启动spark-shell报错The specified datastore driver ("com.mysql.jdbc.Driver") was not found

错误提示:Caused by: org.datanucleus.exceptions.NucleusException: Attempt to invoke the "DBCP" plugin to create a ConnectionPool gave an error : 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.

 

<console>:10: error: not found: value sqlContext
       import sqlContext.implicits._
              ^
<console>:10: error: not found: value sqlContext
       import sqlContext.sql

 

解决方法:

$SPARK_HOME/conf/spark-env.sh文件中配置:

export SPARK_CLASSPATH=$HIVE_HOME/lib/mysql-connector-java-5.1.17.jar

posted @ 2022-05-29 08:31  田领群  阅读(26)  评论(0编辑  收藏  举报