Error

java.sql.SQLException: No database selected

2023. 3. 10. 20:56
목차
  1. 문제
  2. 해결

문제

스프링 부트 학습 중 db를 연결하여 실행시키는 과정에서 에러가 발생했다. https://ewok.tistory.com/358

 

No database selected라는 것으로 보아 db 정보가 누락된 것 같다.

 

spring.datasource.url=jdbc:mariadb://localhost:3306
spring.datasource.driver-class-name=org.mariadb.jdbc.Driver
spring.datasource.username=root
spring.datasource.password=1234

spring.jpa.show-sql=true

위 코드가 application.properties인데 url에 db가 선택되지 않았다.

 

 

해결

아래와 같이 db정보를 추가하여 해결하였다.

spring.datasource.url=jdbc:mariadb://localhost:3306/hello-spring
spring.datasource.driver-class-name=org.mariadb.jdbc.Driver
spring.datasource.username=root
spring.datasource.password=1234

spring.jpa.show-sql=true

'Error' 카테고리의 다른 글

[missing_user_info_uri] Missing required UserInfo Uri in UserInfoEndpoint for Client Registration  (0) 2023.03.16
org.junit.platform.commons.JUnitException: TestEngine with ID 'junit-jupiter' failed to discover tests  (0) 2023.03.14
[에러] Uncaught ReferenceError: $ is not defined  (0) 2022.12.04
[에러] java.lang.NumberFormatException  (0) 2022.12.03
[에러] java.lang.NullPointerException: Cannot invoke "com.cafe24.nonchrono.dao.WishDAO.list()" because "this.wishDAO" is null  (0) 2022.12.02
  1. 문제
  2. 해결
'Error' 카테고리의 다른 글
  • [missing_user_info_uri] Missing required UserInfo Uri in UserInfoEndpoint for Client Registration
  • org.junit.platform.commons.JUnitException: TestEngine with ID 'junit-jupiter' failed to discover tests
  • [에러] Uncaught ReferenceError: $ is not defined
  • [에러] java.lang.NumberFormatException
ewok
ewok
ewok
기록장
ewok
전체
오늘
어제
  • 분류 전체보기
    • 웹개발 교육
      • HTML
      • CSS
      • JavaScript
      • Database
      • Java
      • jQuery
      • Ajax
      • Bootstrap
      • jsp
      • Spring
      • MyBatis
      • 프로젝트
    • JAVA
    • SpringBoot
      • 기초
      • AWS
      • 개인프로젝트
    • Spring Security
    • JPA
    • 테스트코드
    • Error
    • CS
      • 컴퓨터 구조
      • 이산수학
    • 알고리즘
      • 정리
      • Java
    • SQL
    • 자격증
      • SQLD
      • 정보처리기사
    • Git

블로그 메뉴

  • 홈
  • 태그
  • 방명록

공지사항

인기 글

태그

  • branch
  • 버전 관리
  • 생성자
  • sqld 자격증
  • org.springframework.beans.factory.UnsatisfiedDependencyException
  • SQLD
  • base
  • 노랭이
  • org.hibernate.tool.schema.spi.CommandAcceptanceException
  • merge commit
  • sqld 합격
  • git bash
  • this
  • 브랜치
  • GIT

최근 댓글

최근 글

hELLO · Designed By 정상우.
ewok
java.sql.SQLException: No database selected
상단으로

티스토리툴바

단축키

내 블로그

내 블로그 - 관리자 홈 전환
Q
Q
새 글 쓰기
W
W

블로그 게시글

글 수정 (권한 있는 경우)
E
E
댓글 영역으로 이동
C
C

모든 영역

이 페이지의 URL 복사
S
S
맨 위로 이동
T
T
티스토리 홈 이동
H
H
단축키 안내
Shift + /
⇧ + /

* 단축키는 한글/영문 대소문자로 이용 가능하며, 티스토리 기본 도메인에서만 동작합니다.