로컬에서 mysql5.7버전을 사용하다, 개발서버에 mysql 8.0버전을 설치하여 개발서버의 mysql에 접근을 하려했다.
2023-11-07 09:36:54 [ERROR] [http-nio-8080-exec-1] [o.s.s.w.a.UsernamePasswordAuthenticationFilter] - An internal error occurred while trying to authenticate the user.
org.springframework.security.authentication.InternalAuthenticationServiceException: nested exception is org.apache.ibatis.exceptions.PersistenceException:
### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is cohttp://m.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
하지만 이렇게 에러가 나왔고, 핵심은 DB연결이 안되었다는 것이다.
pom.xml에 가본다
버전이 5버전이다.
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.39</version>
</dependency>
버전이 8버전으로 변경하였다.
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.33</version>
</dependency>
'Dev.BackEnd > Spring & Spring Boot' 카테고리의 다른 글
[스프링부트] 클라이언트와 서버와의 통신(@RequestBody, @ResponseBody, Jackson라이브러리) (0) | 2024.12.24 |
---|---|
http를 https로 변경할 수 있도록 무료 ssl 인증서 발급 (certbot설치) (0) | 2023.11.16 |
[spring boot] multipart타입으로 파일업로드를 할 때 파일사이즈로 인한 오류 해결방법 (0) | 2023.10.17 |
[스프링부트] 알림 기능(실시간 알림 받기) SSE사용 (feat lastEventId) (0) | 2023.10.07 |
SpringBoot: @RequestParam vs @RequestBody이해하기 (0) | 2023.09.20 |