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

2

5 Answers 5

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

Sign up to request clarification or add additional context in comments.

Comments

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

Comments

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

1 Comment

So maybe it's not a false version but a corrupted header?
0

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

Comments

0

For me, I created the h2 database file using 1.4.200 version of h2 JDBC driver and I was connecting to it via different h2 JDBC driver 2.3.232 version.

They have mentioned on their documentation

Between version 1.4.200 and version 2.0.202 there have been considerable changes, such that a simple update is not possible.

https://www.h2database.com/html/migration-to-v2.html

Make sure you are using the compatible version, things have changed after version 2.

This was the error I got: [90048][90048] Unsupported database file version or invalid file header in file "/path/myDatabase.mv.db" [90048-232] The write format 1 is smaller than the supported format 3 [2.3.232/5].

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.