8

As the title reads, I am trying to open a .h2.db file using DataGrip on MacOS. However, I keep getting the error

Unsupported database file version or invalid file header in file

With the error code

[90048-192]

How do I check the actual database file version and how to get the correct driver files(?) ?

Jan
  • 42,290
  • 8
  • 54
  • 79
  • 1
    What's the version currently in use? I would try adding the upgrade JAR to classpath http://www.h2database.com/html/advanced.html#database_upgrade – anttix Nov 30 '16 at 08:17
  • Another idea to try would be to force disable MVCC by explicitly connecting with ;MVCC=FALSE http://www.h2database.com/html/advanced.html#mvcc – anttix Nov 30 '16 at 08:26

3 Answers3

2

For me, the problem was with the JDBC URL in the h2 login screen. It was a random URL and after I changed it to the spring.datasource.url value I had set in my application.properties, it started working.

enter image description here

mnagdev
  • 384
  • 3
  • 11
1

I had this error with a persistent TCP H2 database.

After updating the H2 version, the old persisted database file still existed.

I had to delete the old database file to get rid of the error.

My Error Code was [90048-214].

Sven Döring
  • 3,927
  • 2
  • 14
  • 17
0

Try to connect with a database tool like SQuirreL to your database and execute SELECT H2VERSION() FROM DUAL or select value from information_schema.settings where name = 'info.VERSION'; to get the actual version.

Maybe this link on how to upgrade a h2 database can also be helpful: How to check if a h2 database needs to be upgraded?

One more thing: your database could be corrupted. You could try to recover the data by using the recovery tool http://www.h2database.com/html/advanced.html#using_recover_tool or to check the database on corruption How to check h2 database health and corruption

Community
  • 1
  • 1
actc
  • 672
  • 1
  • 9
  • 23