IDE 에러 해결하기
[IntelliJ] Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured. 오류
아민_
2023. 11. 3. 18:30
728x90
Spring Boot 프로젝트를 생성한 후 최초에 실행할 때
아래와 같은 오류가 발생하면서 정상적으로 실행되지 않았다.
이는 데이터 소스에 대한 url 속성이 지정되지 않았고,
데이터베이스에 대한 드라이버 클래스를 결정하지 못해서 발생한 오류이다.
해결방법
application.properties 파일에서 자신의 데이터베이스 맞게 설정해준다.
MariaDB일 경우에는 아래와 같이 설정할 수 있다.
# 데이터베이스 연결 정보
spring.datasource.url=jdbc:mariadb://localhost:3306/프로젝트명
spring.datasource.driver-class-name=org.mariadb.jdbc.Driver
spring.datasource.username=사용자이름
spring.datasource.password=사용자비밀번호
728x90