[에러노트] Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.

hyewon jeong·2023년 3월 6일
0

에러노트

목록 보기
22/45

1 발생

mysql 의존성 및 application.yml 추가 후 나타난 에러


2 코드

Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.
2023-03-06T15:30:48.747+09:00 ERROR 1853 --- [  restartedMain] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
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
데이터 소스 구성 실패: 'url' 속성이 지정되지 않았으며 포함된 데이터 소스를 구성할 수 없습니다.

이유: 적합한 드라이버 클래스를 결정하지 못했습니다.

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).


Process finished with exit code 0

3 원인

yml 파일은 들여쓰기가 생명인데 , yml 잘 모르기에..생긴일


4 해결

#  datasource:
#    password: ''
#    username: sa
#    url: jdbc:h2:mem:db;MODE=MYSQL;
#  h2:
#    console:
#      enabled: 'true'

# Mysql 설정
  datasource:
    driver-class-name: com.mysql.cj.jdbc.Driver
    url: jdbc:mysql://[RDS 엔드포인트 주소]:3306/mydb?serverTimezone=UTC&characterEncoding=UTF-8
    username: User
    password: 1234
profile
개발자꿈나무

0개의 댓글