title: Scala and MySQL JDBC Driver
body: <p>I'm currently working on a SBT-based Scala project and I need to use MySQL as database (through Slick 3.0.0 library).</p>
  
  <p>The issue is that I can't connect to the database because of this exception:</p>
  
  <pre><code>&gt; service[ERROR] java.sql.SQLException: No suitable driver
  service[ERROR]  at java.sql.DriverManager.getDriver(DriverManager.java:315)
  service[ERROR]  at slick.jdbc.DriverBasedJdbcDataSource$class.registerDriver(JdbcDataSource.scala:60)
  service[ERROR]  at slick.jdbc.DriverJdbcDataSource.registerDriver(JdbcDataSource.scala:72)
  service[ERROR]  at slick.jdbc.DriverJdbcDataSource.&lt;init&gt;(JdbcDataSource.scala:78)
  service[ERROR]  at slick.jdbc.JdbcBackend$DatabaseFactoryDef$class.forURL(JdbcBackend.scala:101)
  service[ERROR]  at slick.jdbc.JdbcBackend$$anon$3.forURL(JdbcBackend.scala:33)
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/IY4r6.png" alt="enter image description here"></p>
  
  <p>What I've done so far (see screenshot): </p>
  
  <ul>
  <li><p>I made sure the MySQL server is running.</p></li>
  <li><p>I've added <strong>mysql-connector-java</strong> dependency the <strong>build.sbt</strong> file.
  The jar gets downloaded correctly (see column on the left).</p></li>
  <li><p>I've used this to get a connection to the database:</p>
  
  <pre><code>val db = Database.forURL(
    "jdbc:mysql/localhost:3306/service",
    "service",
    "service",
    driver="com.mysql.jdbc.Driver"
  ) 
  </code></pre></li>
  </ul>
  
  <p>Any idea on how to solve this?</p>
  
  <p>Thanks.</p>