1.依赖
<!-- Mysql驱动包 -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.24</version>
</dependency>
<!-- Druid -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>1.2.16</version>
</dependency>
<!-- Dynamic DataSource -->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>dynamic-datasource-spring-boot-starter</artifactId>
<version>3.5.2</version>
</dependency>
2.秘钥密码生成,生成privateKey,publicKey,和加密之后的password
3.配置,如下图,注意:密码需要用ENC()包裹 ENC(password)这种格式
标签:加密,spring,数据源,druid,密码,mysql From: https://www.cnblogs.com/h-w-b/p/17898351.html