This is an incorrect error message that appears only in 1.4.198 and 1.4.199. The next version of H2 (1.4.200) will show a better message like
Database … not found, either pre-create it or allow remote database creation (not recommended in secure environments)
You see this error message because your database doesn’t exist yet. The normal way to fix your problem is to create the database first with your application before trying to login into it with H2 Console.
H2 Console can be configured to allow database creation, but it may create a security hole in your system, anyone who can open this page may do anything with your system with yours access permissions in such configuration.
Note that H2 Console in browser’s session launched by H2 from its icon in the system tray (you can simply launch the h2-1.4.199 jar as Java application, or use
java -jar h2-1.4.199.jar) gives you permission to create a new database in secure way. You can use it for that purpose. If you’re not planning to use it as a TCP Server, close it from the system tray icon after database creation to make sure that it doesn’t hold your database. You can also use the command-line Shell tool:
H2 Console from the Spring doesn’t ship with such feature.
Older versions of H2 (up to 1.4.197) also allow the database creation, including the console from the Spring, but, again, it creates a security hole in you system.
Leave an answer