Error

Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.

YoonJong 2022. 11. 1. 13:00
728x90

에러내용

Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.

에러원인

스프링 부트 초기 애플리케이션 시작 시 해당 에러발생.

JDBC 초기설정이 필요하다.

 

에러조치

 

application.properties 는 아래와같은방법

spring.datasource.url=jdbc:[Database]://localhost:3306/[Database스키마]
spring.datasource.username=[DB 아이디]
spring.datasource.password=[DB 비밀번호]
spring.datasource.driver-class-name=[JDBC 드라이버]

 

application.yml 은 아래 방법

spring:
  datasource:
    url: jdbc:[Database]://localhost:3306/[Database스키마]
    username: [DB 아이디]
    password: [DB 비밀번호]
    driver-class-name: [JDBC 드라이버]
728x90