Wrong user name or password on freshly installed h2 database

58 views
Skip to first unread message

Bartek

unread,
Jun 6, 2019, 11:20:27 PM6/6/19
to H2 Database
Hello,

I'm trying to use h2 database (version 1.4.197, last stable) on Windows 10 but stumbled upon problem so simple that I'm even embarrassed about asking.
I can't log in to the database using default settings as presented:

IMG1.PNG






















Driver class: org.h2.Driver
JDBC URL: jdbc:h2:~/test
User Name: sa
Password: 

I've got istalled java properly, tried to reinstall H2 Database and some other things but nothing helped. Maybe reinstalling doesn't reset settings?

IMG2.PNG

Evgenij Ryazanov

unread,
Jun 7, 2019, 2:10:51 AM6/7/19
to H2 Database
Hello.

It looks like you already have a database in the file with name test.h2.db or test.mv.db in your home directory and that database doesn't have a user with same sa and empty password. If you need this database, use the recovery tool, it should be able to restore unencrypted database without knowing its password. If you sure that you don't need it, just delete the database file.

Evgenij Ryazanov

unread,
Jun 7, 2019, 2:20:52 AM6/7/19
to H2 Database
You can also change the file name in JDBC URL to a different one to create a new database. 
Reply all
Reply to author
Forward
0 new messages