spark java.lang.ClassNotFoundException: com.mysql.jdbc.Driver

在用spark连接mysql数据库时出现java.lang.ClassNotFoundException: com.mysql.jdbc.Driver报错,可以
通过设置–driver-class-path /path/mysql-connector-java-5.1.46.jar来完美解决

/home/hadoop/spark/spark-2.4.0-bin-hadoop2.7/bin/spark-submit --driver-class-path /home/hadoop/wocloud/java/mysql-connector-java-5.1.46/mysql-connector-java-5.1.46.jar   sparkConnectMysql.py

你可能感兴趣的:(随笔)