Matija Kovacek
Matija Kovacek

Reputation: 310

Playframework 2.5.4. Cannot connect to database [db] (MySql)

I have created new play-scala app and I can't connect to mysql db.
Erorr: Configuration error
Cannot connect to database [db]
c.z.h.HikariConfig - either dataSource or dataSourceClassName is required, more details here

To the same db with the same config I can connect with play 2.2.3

build.sbt
application.conf

Upvotes: 1

Views: 1027

Answers (1)

Salem
Salem

Reputation: 12996

You are using db.db.default.* instead of db.default.*.

In your config:

db {
  db.default.driver=com.mysql.jdbc.Driver
  db.default.url="jdbc:mysql://localhost:3306/sc_cvs"
  # (...)
}

Correct:

db {
  default.driver=com.mysql.jdbc.Driver
  default.url="jdbc:mysql://localhost:3306/sc_cvs"
  # (...)
}

Upvotes: 4

Related Questions