Step-by-Step
[Spring] 초기 실행 - Failed to configure a DataSource 본문
초기 실행시 발생하는 에러 - 데이터베이스 연결하기 위한 정보가 없음
***************************
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
Database 연결하기 위한 DataSource가 없어서 그렇다
해결
내가 쓴 예전 글을 참조해서 작성함 : https://smile-development.tistory.com/55
# MySQL 설정
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
# DB Source URL
spring.datasource.url=jdbc:mysql://localhost:3306/[DB이름]
# DB username
spring.datasource.username=[DB 사용자이름]
# DB password
spring.datasource.password=[DB 비밀번호]
이걸 Application.properties에 추가해주면 끝!
'프로젝트 > 시행착오' 카테고리의 다른 글
[Spring] Spring Security 로그인 폼 삭제 & 403 Forbidden 해결 (0) | 2023.02.20 |
---|---|
[Spring] Lombok 설치해도 사용이 안 되는 경우 (0) | 2023.02.16 |
Comments