스프링부트
[스프링부트] MariaDB 연동 - DataSource Configuration
dreamstalker
2024. 8. 3. 12:00
***************************
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
위와 같은 오류를 console창에서 보게 된다면 스프링부트에서 MairaDB 연결 설정이 필요해서 입니다. 아래 순서대로 해봅시다.
- 아래 경로로 이동하기
src > main > resouces> application.properties - application.properties파일에서 아래 내용 넣기
- 아래 부분엣 dbname(생성한 데이터베이스 이름), dbuser(DB에 접속할 사용자 이름), dbpass(비밀빈호)
spring.datasource.driver-class-name=org.mariadb.jdbc.Driver
spring.datasource.url=jdbc:mariadb://localhost:3306/dbname
spring.datasource.username=dbuser
spring.datasource.password=dbpass