在连接的url字符串后面添加allowPublicKeyRetrieval=true即可
如果添加多条,需要在之间添加"&",例如
conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/liush?useSSL=false&allowPublicKeyRetrieval=true","root","123456");
本文介绍了在数据库连接URL中添加`allowPublicKeyRetrieval=true`的用法,以及如何与其他参数如`useSSL=false`配合使用,以确保安全有效地连接到MySQL数据库。示例代码展示了如何在Java中构建连接字符串。
在连接的url字符串后面添加allowPublicKeyRetrieval=true即可
如果添加多条,需要在之间添加"&",例如
conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/liush?useSSL=false&allowPublicKeyRetrieval=true","root","123456");

被折叠的 条评论
为什么被折叠?