## 加密文本
### 使用外部数据源数据库连接配置示例
原始配置如下:
```json
[
{
"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`字段改为密文存储。
### 加密步骤
在服务器控制台中输入命令来加密密码:
```shell
ctl -en 123456
```
复制输出的加密字符串 `(ENCRYPT:P9HOhqR_SJ0)` 并将其写入配置文件中的相应位置。
修改后的配置如下:
```json
[
{
"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
}
]
```
这样就完成了配置文件中密码的密文配置。
评论