AllowPublicKeyRetrieval=True可能允许恶意代理执行MITM攻击以获取明文密码,因此它在默认情况下为False,必须显式启用。
在配置mysql的url时 加上
&allowPublicKeyRetrieval=true
附 完整 url
url: jdbc:mysql://localhost:3306/szf?useUnicode=true&characterEncoding=utf8&useSSL=false&allowMultiQueries=true&allowPublicKeyRetrieval=true