본문 바로가기
Error & Exception

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

by unknownomad 2022. 4. 3.

에러메시지

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

에러 원인

[원인 1]

/h2-console 에서 jdbc:h2:mem:testdb 데이터 베이스 찾을 수 없음
or 데이터 베이스를 미리 생성(pre-create) 불가
or 원격 데이터 생성 불가

 

[원인 2]

https://github.com/h2database/h2database/issues/1901

h2 버전 중 1.4.1971.4.198 사이에서 대규모 업데이트 진행
➡ 데이터 베이스 미리 생성 방지 설정됨

해결 방법

[방법 1]

  • application.properties에서 spring.datasource.url에 DB 식별자 설정
spring.h2.console.enabled=true
spring.datasource.url=jdbc:h2:mem:testdb

 

[방법 2]

  • h2 버전 : 1.4.198 보다 낮게 설정
runtimeOnly 'com.h2database:h2:1.4.197'

 


출처

https://github.com/binchoo/spring-boot-210523/issues/10

https://bgpark.tistory.com/78

https://github.com/h2database/h2database/issues/1901

댓글