반응형

failed to determine a suitable driver class

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

 

계속 이런 에러가 났었다

40분의 구글링 끝에 찾아낸 이유는 build.gradle 파일에 driver connector 설정을 해줘야하는데 설정을 안한 것이였다

Maven 은 pom.xml에서 설정을 해줘야한다

 

 

build.gradle 파일에 dependencies { } 안에 밑의 2줄을 추가하면 설정이 된다 

implementation 'mysql:mysql-connector-java'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'

 

 

 

 

dataSource의 설정은 application.properties 파일에 넣어주면 된다

spring.datasource.url=jdbc:mysql://[host 주소]:[포트번호]/[Database 이름]?serverTimezone=Asia/Seoul&characterEncoding=UTF-8
spring.datasource.username=[계정 아이디]
spring.datasource.password=[계정 비밀번호]
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver

 

 

 


감사합니다.. 덕분에 해결했습니다💖💖

https://dkswngus7.tistory.com/13

반응형
복사했습니다!