HowTo, Tips

MySQL Public Key Retrieval is not allowed 에러처리

쇼크리더 2021. 12. 15. 08:00
반응형

환경

  • OS : Mac Big Sur (버전 11.6)
  • DBeaver : 버전 21.3.1.202112130652
  • MySQL : Ver 8.0.27 for macos11

MySQL 연결 시 아래와 같은 메시지가 나타날 수 있습니다.

Public Key Retrieval is not allowed

 

에러 처리

AllowPublicKeyRetrieval 설정값 true로 변경

1. DBeaver

DBeaver의 경우 Connection Settings > Devier properties > AllowPublicKeyRetrieval 값 true로 변경

2. JDBC

jdbc:mysql://localhost:3306/db_name?allowPublicKeyRetrieval=true&useSSL=false

 

정상적으로 연결된 모습

참고

해당 옵션은 8.0.10 커넥터부터 도입되었습니다.

 

이에 대한 자세한 설명은 MySQL Connector Guide 참고 바랍니다.

출처 링크에서 주의사항도 꼭 읽어보시기 바랍니다.

 

Setting this option to true informs Connector/NET that RSA public keys should be retrieved from the server and that connections using the classic MySQL protocol, when SSL is disabled, will fail by default. Exceptions to the default behavior can occur when previous successful connection attempts were made or when pooling is enabled and a pooled connection can be reused. This option was introduced with the 8.0.10 connector.

출처 : https://dev.mysql.com/doc/connector-net/en/connector-net-8-0-connection-options.html

 

도움되셨길 바랍니다.

반응형