2023-10-14 작성

H2 console 접속 오류 해결법 : Database "C:/Users/사용자명/test" not found, either pre-creat

문제 발생

서버를 실행시키고 http://localhost:8080/h2-console 를 입력하여 H2 콘솔 접속시 다음과 같은 에러가 발생한다. 

데이터베이스 "C:/Users/사용자명/test"를 찾을 수 없다고 나온다. 말그대로 C:\Users\사용자명 폴더에 test 파일이 없어서 생긴 문제이므로 직접 만들어주자.

Database "C:/Users/사용자명/test" not found, either pre-create it or allow remote database creation (not recommended in secure environments) [90149-214] 90149/90149 (Help)

해결 방법

C:\Users\사용자명 경로에 빈 텍스트 파일을 생성하고 파일명을 확장자 포함하여 test.mv.db로 바꾸고 다시 [Connect] 버튼으로 연결을 시도해보자.

그럼 아래처럼 h2 콘솔에 접속하여 쿼리를 다룰 수 있다!