How to read data from mysql using pyspark


Learn Spark 1.6.x or Spark 2.x on our state of the art big data labs

  • Click here for access to state of the art 13 node Hadoop and Spark Cluster


Launch pyspark with below command

pyspark --jars /usr/share/java/mysql-connector-java.jar --master yarn --conf spark.ui.port=12643

and run the below code

mysql ="jdbc").\
 option("url", "jdbc:mysql://").\
 option("driver", "com.mysql.jdbc.Driver").\
 option("dbtable", "orders").\
 option("password", "itversity").\