본문 바로가기
도구/Intellij

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

by 작은소행성 2021. 10. 7.

 

 

spring boot 처음실행 시 다음과 같은 에러가 났다.  

 

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

 

 

 

 

 

application.properties 에 JDBC url 을 추가해준다. 

 

 

[mysql]

spring.datasource.driver-class-name=com.mysql.jdbc.Driver

spring.datasource.url=jdbc:mysql://localhost:3306/[DB스키마명]?autoReconnect=true
spring.datasource.username=[DB접속Id]
spring.datasource.password=[DB접속Password]



 

 

[postgres]

spring.datasource.driverClassName=org.postgresql.Driver
spring.datasource.url=jdbc:postgresql://localhost:5432/[DB스키마명]?characterEncoding=UTF-8&serverTimezone=UTC
spring.datasource.username=[DB접속Id]
spring.datasource.password=[DB접속Password]

 

 

 

 

반응형