1. 找到对应版本Druid仓库
![](https://i-blog.csdnimg.cn/blog_migrate/38fe49e4ea90b6a4f57af5889a13a461.png)
2. 按住Shift打开PowerShell并输入以下命令, 例如我的密码为root Druid版本为1.1.22 (替换命令中的版本及密码root)
java -cp druid-1.1.22.jar com.alibaba.druid.filter.config.ConfigTools root
3. 将控制台返回的公钥及密码填写至对应yml配置文件
datasource:
master:
url: jdbc:mysql://127.0.0.1:3306/gkt_bigdata?useUnicode=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
username: root
# password: root
password: RypyclrY2P+O5KpPtcYe7L7OT3Idl/seT6H7OfRhWZ/vTp41Y3a/yeFFBBHOrTky5sCqrF1UAPLR0t/REsr1Bg==
driver-class-name: com.mysql.cj.jdbc.Driver
druid:
public-key: MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAJkgiwKX0f+OXdbAwXytqkLTaycyw/iKycCdQgvUQ30ddJ6bZcBbjcpND0ovvlxf9KsV5AUSOEIcZFpWKQsYwn8CAwEAAQ==
4. mvn install 重启服务即可