I'm trying to get Slick 3.0 running with MySql. I've made the following changes to the hello-slick-3.0 activator project:
In
application.conf
I've removed theh2mem1
entry and replaced it with:horridDBStuff = { url = "utterlyhorriddb.blahblahblah.us-west-2.rds.amazonaws.com:3306" driver = com.mysql.jdbc.Driver connectionPool = disabled keepAliveConnection = true }
I've replaced each
Database.forConfig("h2mem1")
entry in the scala code withDatabase.forConfig("horridDBStuff")
I've replaced each
import slick.driver.H2Driver.api._
withimport slick.driver.MySQLDriver.api._
In
build.sbt
I've added tolibraryDependencies
the item"mysql" % "mysql-connector-java" % "5.1.35"
It compiles fine, but running gives the error Exception in thread "main" java.sql.SQLException: No suitable driver
coming from the line val db = Database.forConfig("horridDBStuff")
.
How can I get Slick 3.0 running with MySql? Am I missing something simple here, or are there any other working examples? Thanks.