-
[Spring boot] MySql 연결 에러, com.mysql.cj.jdbc.driverSpring Boot 2022. 1. 19. 00:01
[스프링 부트] MySql 연결 에러,
com.mysql.cj.jdbc.driver
this is deprecated. the new driver class is `com.mysql.cj.jdbc.driver'. the driver is automatically registered via the spi and manual loading of the driver class is generally unnecessary.
뭔데
4.4.1.3 Changes in the Connector/J API The name of the class that implements java.sql.Driver in MySQL Connector/J has changed from com.mysql.jdbc.Driver to com.mysql.cj.jdbc.Driver. The old class name has been deprecated. 버전 업데이트에 따라 Class 이름이 변경 되었다고 한다.
application.properties 사용
application.properties 을 사용할 경우 아래와 같이 변경한다.
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
application.yml 사용
application.yml 을 사용할 경우 아래와 같이 변경한다.
spring: datasource: driver-class-name: com.mysql.jdbc.Driver
spring: datasource: driver-class-name: com.mysql.cj.jdbc.Driver
Post
References
잘못된 코드나 내용이 있다면 댓글을 남겨주세요. 즉시 수정하도록 하겠습니다! :)
'Spring Boot' 카테고리의 다른 글
[스프링 부트] 예외처리(Exception) @ControllerAdvice @RestControllerAdvice @ExceptionHandler @ResponseStatus (0) 2022.02.14 Logback이란? feat.SLF4J (0) 2022.01.30 로그(log) 기록하기, SLF4J란? (0) 2022.01.29 [스프링 부트] InvalidDataAccessApiUsageException: Unknown entity #그래들 멀티 모듈 (0) 2022.01.28 인텔리제이에 spring-boot-devtools 추가하기 (0) 2021.12.11