Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |
Tags
- 클라우드에서 도커 실행하기
- GCP
- Spring MVC 구성요소
- String.valueOf()
- vm인스턴스생성
- 프로그래머스
- 재귀함수
- 백준
- 코딩테스트
- Spring MVC 동작원리
- 싱글톤패턴
- 스택
- List.of
- java
- 코드스테이츠
- 버블정렬
- 구간합구하기
- 투포인터알고리즘
- 11659
- 인텔리제이
- OOP
- Array.asList
- 알고리즘
- MySQL
- 코드스테이츠 백엔드
- 자바
- 성능테스트툴
- Spring Web MVC
- 재귀와반복문
- 백준 11659
Archives
- Today
- Total
순간을 기록으로
Database "mem:test" not found, either pre-create it or allow remote database creation (not recommended in secure environments) [90149-214] 90149/90149 (Help) 본문
Error
Database "mem:test" not found, either pre-create it or allow remote database creation (not recommended in secure environments) [90149-214] 90149/90149 (Help)
luminous13 2022. 9. 20. 23:58상황
h2 웹 콘솔에서 연결하기를 눌렀을 때 뜬 오류
문제
프로젝트를 실행할 때마다 H2 DB 연결을 위한 URL을 랜덤하게 생성하여 주지만 그 주소가 아니라 jdbc:h2:mem:test라는 URL로 접속하는게 문제였다.
실제로 프로젝트를 실행하면 접속할 JDBC URL을 주고 있는것을 확인할 수 있었다.
이 주소를 입력하니 실제로 H2 DB에 접속할 수 있었다!
하지만 실행할 때 매번 주소가 바뀌기 때문에 테스트할 때 번거롭다는 불편한 상황을 마주치게 된다.
해결
application.properties 파일에 아래와 같이 JDBC URL을 명시적으로 작성하면 앞으로 그 URL로 변경없이 접속할 수 있다.
spring.datasource.url=jdbc:h2:mem:testdb
참고
What is the default name of embedded H2 database in Spring Boot?
As I've read the default name of the embedded H2 database in Spring Boot should be testdb, but if I try to connect to with the H2 Console, I get the following error: Database "mem:testdb"...
stackoverflow.com
https://stackoverflow.com/questions/61865206/springboot-2-3-0-while-connecting-to-h2-database
'Error' 카테고리의 다른 글
Comments