【Mysql】Docker连接容器中的mysql 8报错 Public Key Retrieval is not allowed

容器A中的程序连接容器B的mysql,报错Public Key Retrieval is not allowed。

解决办法如下:(在连接数据库的链接中加上)

当容器A程序连接容器B数据库时,useSSL=false&allowPublicKeyRetrieval=true

当本地连接容器中mysql时,useSSL=false

useSSL=false&allowPublicKeyRetrieval=true is what I needed only

when I tried connecting from docker_container1 to docker_container2_mysql(where mysql is installed) 

within my local host. While from my host machine to docker_container2_mysqluseSSL=false is enough.

https://stackoverflow.com/questions/50379839/connection-java-mysql-public-key-retrieval-is-not-allowed#

猜你喜欢

转载自www.cnblogs.com/AwenDF/p/11585497.html