문제상황


스프링부트에서 http://localhost:8080/h2-console H2 데이터베이스 웹 콘솔에 접근하던 중 다음과 같은 오류가 발생하였다.

오류 메세지

Database "mem:testdb" not found, either pre-create it or allow remote database creation (not recommended in secure environments) [90149-214] 90149/90149 (Help)

현재 application.properties

spring.h2.console.enabled=true


해결방법


application.properties를 수정

spring.h2.console.enabled=true
spring.datasource.url=jdbc:h2:mem:testdb

  • datasource.urljdbc:h2:mem:testdb 로 명시해준 후 다시 Connect하면 정상적으로 웹 콘솔에 접속되는 것을 확인할 수 있다.

웹 콘솔 접속



참고

https://stackoverflow.com/questions/61865206/springboot-2-3-0-while-connecting-to-h2-database

0개의 댓글

Powered by GraphCDN, the GraphQL CDN