title: ClassNotFoundException on connecting MariaDB using Spark
body: <p>I am trying to connect Spark to MariaDB and I am getting </p>
  
  <blockquote>
    <p>Exception in thread "main" java.lang.ClassNotFoundException: org.mariadb.jdbc.Driver</p>
  </blockquote>
  
  <p>Now before you mark it as duplicate, I know what the error means and I've read different threads but with no success.</p>
  
  <p>This is my <code>build.sbt</code></p>
  
  <pre><code>scalaVersion := "2.11.8"
  
  name := "SparkJdbc"
  
  libraryDependencies ++= Seq(
      "org.apache.spark" %% "spark-core" % "2.0.2",
      "org.apache.spark" %% "spark-sql" % "2.0.2",
      "org.mariadb.jdbc" % "mariadb-java-client" % "1.5.2"
  )
  </code></pre>
  
  <p>I also have the jar seperately and I've tried</p>
  
  <pre><code>spark-submit --class SparkJdbc target/scala-2.11/sparkjdbc_2.11-0.1-SNAPSHOT.jar 
  --jars /path/to/mariadb-java-client-1.5.2.jar
  </code></pre>
  
  <p>but this also failed with the same error.</p>
  
  <p>The following is the code I am using to connect</p>
  
  <pre><code>val (driver, url, username, password) = ("org.mariadb.jdbc.Driver", "jdbc:mysql://localhost/db1", "user", "password");
  
  Class.forName(driver).newInstance;
  
  val data = spark.sqlContext.read
      .format("jdbc")
      .option("url", url)
      .option("user", username)
      .option("password", password)
      .option("dbtable", "SELECT * FROM db1.football LIMIT 10")
      .load();
  </code></pre>