title: Not able to connect MysqlDB through python spark
body: <p>I want to save my processed rdd into mysql table for that i am using SparkDataFrame but i getting follwing error</p>
  
  <pre><code>py4j.protocol.Py4JJavaError: An error occurred while calling o216.jdbc.
  : java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/student?user=root&amp;password=root.
  </code></pre>
  
  <p>i added mysql-jar to sparkshell</p>
  
  <p>spark-shell -–driver-class-path /path-to-mysql-jar/mysql-connectorjava-5.1.38-bin.jar. </p>
  
  <pre><code>    from pyspark import SparkContext
      from datetime import datetime
      import os
      import sys
      from pyspark.sql import SQLContext, Row
      sqlContext = SQLContext(sc)
      file1 = sc.textFile("/home/hadoop/text1").cache()
      file2 = sc.textFile("/home/hadoop/text2").cache()
      file3 = file1.union(file2).coalesce(1).map(lambda line: line.split(','))
      file1.unpersist()
      file2.unpersist()
      result = file3.map(lambda x: (x[0]+', '+x[1],float(x[2]))).reduceByKey(lambda a,b:a+b).sortByKey('true').coalesce(1)
      result = result.map(lambda x:x[0]+','+str(x[1]))\
      schema_site = sqlContext.createDataFrame(result)
      schema_site.registerTempTable("table1")
      mysql_url="jdbc:mysql://localhost:3306/test?user=root&amp;password=root&amp;driver=com.mysql.jdbc.Driver"
      schema_site.write.jdbc(url=mysql_url, table="table1", mode="append")
  </code></pre>
  
  <p>i am using spark spark-1.5.0-bin-hadoop2.4</p>
  
  <p>also setup hive metastore.</p>
  
  <p>So how could i load my RDD result into Mysql table.</p>
  
  <p>input file is </p>
  
  <pre><code>  file1 contents are
  
    1234567  65656545  12
  
    1234567  65675859  11 
  
    file2 contents are,
  
    1234567  65656545  12
  
    1234567  65675859  11
  
   and the resultnat RDD is like
  
   1234567  65656545 24
  
   1234567  65675859  22
  
  i created the table in mysql with three colunm,
  
  std_id  std_code  std_res
  </code></pre>
  
  <p>and i want the table output like,</p>
  
  <pre><code>  std_id  std_code  std_res
  
    1234567  65656545    24
  
     1234567  65675859   24
  </code></pre>