容器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_mysql
, useSSL=false
is enough.