import mysql.connector
from pyspark.sql import SparkSession
spark = SparkSession.builder.config("spark.jars", "/usr/share/java/mysql-connector-java-8.0.29.jar")\
.master("local").appName("Integrated_ca2").getOrCreate()
connection = mysql.connector.connect(user='root', database='tweets',
password='password',host='localhost'
,auth_plugin='mysql_native_password')
cursor = connection.cursor()
cursor.execute("USE tweets;")
f = spark.read.format("jdbc").option("url", "jdbc:mysql://localhost:8888/tweets") \
.option("driver", "com.mysql.jdbc.Driver").option("dbtable","tweets_ca2").option("user", "root").option("password","password").load()
cursor.execute('select * from tweets_ca2;')
the error is Py4JJavaError: An error occurred while calling o321.load. : java.lang.ClassNotFoundException: com.mysql.jdbc.Driver