使用外部数据源时,数据库连接配置如下:
[
{
"url":"jdbc:mysql://192.168.0.1:3306/xxxx?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC",
"username" : "admin",
"password" :"123456",
"driverClassName" : "com.mysql.cj.jdbc.Driver",
"includes": [],
"excludes": [],
"enable" : true
}
]出于安全考虑,现在把 password 改为密文存储。
在服务器控制台中输入以下命令:
ctl -en 123456
复制出 (ENCRYPT:P9HOhqR_SJ0) 写入配置文件中
[
{
"url":"jdbc:mysql://192.168.0.1:3306/xxxx?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC",
"username" : "admin",
"password" :"(ENCRYPT:P9HOhqR_SJ0)",
"driverClassName" : "com.mysql.cj.jdbc.Driver",
"includes": [],
"excludes": [],
"enable" : true
}
]这样就完成了配置文件中密码的密文配置。
相关内容
浙公网安备33010602013943号


