h2 database: Unsupported database file version or invalid file header in file
Asked Answered
R

4

12

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(?) ?

Rayborn answered 21/11, 2016 at 20:56 Comment(2)
What's the version currently in use? I would try adding the upgrade JAR to classpath h2database.com/html/advanced.html#database_upgradeClew
Another idea to try would be to force disable MVCC by explicitly connecting with ;MVCC=FALSE h2database.com/html/advanced.html#mvccClew
C
4

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].

Curnin answered 21/2, 2023 at 21:16 Comment(0)
K
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

Kimmie answered 15/8, 2022 at 7:4 Comment(0)
I
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

Interlinear answered 6/12, 2016 at 10:8 Comment(1)
So maybe it's not a false version but a corrupted header?Interlinear
B
0

I had the same issue when I downgrading Spring Boot version. Try restore Spring Version back to original.

Bonds answered 29/4 at 16:30 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.