다가오는 다음을 향해

[MySQL] java.sql.SQLNonTransientConnectionException: Public Key Retrieval is not allowed 본문

Database/MySql

[MySQL] java.sql.SQLNonTransientConnectionException: Public Key Retrieval is not allowed

hyeseo 2022. 9. 23. 22:45
java.sql.SQLNonTransientConnectionException: Public Key Retrieval is not allowed

 

❗️에러 발생 원인


useSSL=false로 설정하고 allowPublicKeyRetrieval 설정을 하지 않은 경우입니다.

 

 

☘️ 해결 방법


allowPublicKeyRetrieval=true

DB Source URL에 위 설정을 추가 했습니다.

 

 

application.properties.yml - 소스 수정

-- 수정전
spring.datasource.url=jdbc:mysql://localhost:3309/ex?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&defaultFetchSize=1000&useSSL=false

-- 수정 후
spring.datasource.url=jdbc:mysql://localhost:3309/ex?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&defaultFetchSize=1000&useSSL=false&allowPublicKeyRetrieval=true

 

 

'Database > MySql' 카테고리의 다른 글

[MySql] PRIMARY KEY 설정하는 방법  (0) 2022.06.23
[MySQL] Error : bad SQL grammar  (0) 2022.04.21