Scala Playframework connect to mysql
Junho 7, 2015 Deixe um comentário
I’m writting this because I had issues following the documentation that comes with playframework
the docs are wrong or at least for me it gave me an error.
The docs states that to connect to a mysql database server you have to do the following:
If you need to connect to another JDBC-compliant database, first add the corresponding driver library to your application dependencies in build.sbt e.g.:
libraryDependencies += "mysql" % "mysql-connector-java" % "5.1.18"
This above works ok, I had no problems.
Then add the corresponding JDBC configuration to the
db.url=jdbc:mysql:database_name db.driver=org.mysql.Driver db.user=root db.pass=secret
This above now has problems namely the db.driver section it returned me an error
Searching the internet I found this answer
So the correct working version is:
Maybe for others this is easy to spot but for me it wasn’t.