Development/SpringBoot

SpringBoot 실행시 'Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.' 에러 발생

Jamie 2021. 2. 17. 20:16
반응형

 

IntelliJ를 이용하여 SpringBoot 프로젝트를 Run했을때, 다음과 같은 오류가 발생하면서 실행이 되지 않는 경우가 발생하였습니다.

 

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

 

상세한 결과는 아래와 같습니다.

 

***************************

APPLICATION FAILED TO START

***************************

Description:

 

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

 

Reason: Failed to determine a suitable driver class

 

Action:

 

Consider the following:

If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.

If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).

 

 


저의 경우는 MariaDB 데스크탑에 설치이후에 SpringBoot Running하니 발생하기 시작했습니다.

Database 설치하면 IntelliJ JDBC Driver 연결해주어야한다고 합니다.

IntelliJ에서는 application.properties 다음과 같이 JDBC url 추가해줍니다.

 

#mariadb

spring.datasource.driverClassName=org.mariadb.jdbc.Driver

spring.datasource.url=jdbc:mariadb://localhost:3306/test?characterEncoding=UTF-8&serverTimezone=UTC

spring.datasource.username=root (혹은 MariaDB 설치시 설정했던 사용자이름)

spring.datasource.password=MariaDB 설치시 생성했던 비밀번호

 

Mariadb 다른 포트에 설치하셨으면 jdbc:mariadb://localhost 다른포트번호를 적어줘야합니다.

mySql이나 Oracle 다른 DB 설치하셨으면 application.properties에 알맞은 url 정보를 기재해주세요.

 

반응형