0

Unable to access play project embedded H2 database, i followed recommendations, and run h2-browser within the same play console as explained here:

Accessing play project database with h2-browser

My Play framework settings ( 2.3.10)

db.default.url="jdbc:h2:mem:play"
db.default.driver=org.h2.Driver
db.default.username=sa
db.default.password=""

But i keep getting this error: Wrong user name or password [28000-180] 28000/28000 (Help)

enter image description here

Community
  • 1
  • 1
Levijatanu
  • 371
  • 2
  • 17

2 Answers2

0

The Play 2.3.x JDBC datasource is managed by BoneCP

Correctly define User name

 db.default.user=sa

So I used settings from more recent version Play framework 2.5.x is using HikaryCP where this would be correct

 db.default.username=sa
Levijatanu
  • 371
  • 2
  • 17
0

Check this link, I tried to describe.

Reason:

When connecting to the H2 database for the first time, the H2 database initializes the user name and password, but properties the database user name and password are defined in the configuration file , causing a conflict.

Solution:

  1. Close the program and close the database connection (if the program is not closed, an error will be reported and cannot be changed)
  2. Delete the database and delete the xml file in dataSources under .idea
  3. Recreate the database and start the project
Psyduck
  • 84
  • 2
  • 9