连接mysql832 报错 Public Key Retrieval is not allowed
这个错误通常是由于MySQL驱动程序使用了旧的身份验证协议而引起的。要解决这个问题,可以在连接URL中添加allowPublicKeyRetrieval=true参数,它将启用新的身份验证协议。
例如,连接URL可能看起来像这样:
jdbc:mysql://localhost:3306/mydatabase?allowPublicKeyRetrieval=true
如果你正在使用JDBC驱动程序,你可以在连接代码中添加以下行:
Properties props = new Properties();
props.put("allowPublicKeyRetrieval", "true");
Connection conn = DriverManager.getConnection(url, props);
这应该解决这个问题。
原文地址: https://www.cveoy.top/t/topic/0rD 著作权归作者所有。请勿转载和采集!