In Springboot 2.3.0.RELEASE I am getting the the following error while connecting to h2 database in the console
Database "mem:testdb" not found, either pre-create it or allow remote database creation (not recommended in secure environments) [90149-200] 90149/90149
H2 Console Before accessing the H2 database, we must enable it by using the following property. Once we have enabled the H2 console, now we can access the H2 console in the browser by invoking the URL http://localhost:8080/h2-console. The following figure shows the console view of the H2 database.
In this article, you'll learn how to use Spring Data JPA with the H2 database in a Spring Boot project for storing, accessing, updating and deleting data (CRUD operations). H2 is an open-source in-memory SQL database written in Java.
Access the H2 Console You can access the console at the following URL: http://localhost:8080/h2-console/. You need to enter the JDBC URL, and credentials.
You can fix this by setting the spring.datasource.url
property like so:
spring.datasource.url=jdbc:h2:mem:testdb
Prior to Spring Boot 2.3.0-RELEASE this was the default, but I'm not sure where it's set. As of 2.3.0-RELEASE, the schema looks to be a randomly generated GUID.
Step 1. In application.properties:
spring.h2.console.enabled=true spring.datasource.url=jdbc:h2:mem:testdb
Step 2. Start your Spring Boot App and open:
http://localhost:8080/h2-console/
If you still face issue try pasting the URL value which you mentioned in application.properties jdbc:h2:mem:testdb
in
JDBC URL of h2-console
Then you wont face below mentioned issue Database h2 not found, either pre-create it or allow remote database creation (not recommended in secure environments) [90149-200] 90149/90149 (Help)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With