cmd命令:
1、切换的druid-0.2.9.jar包所在目录 2、在命令行中执行如下命令:java -cp druid-0.2.9.jar com.alibaba.druid.filter.config.ConfigTools you_password
即输出加密后密码
3、4、数据源配置
加入引入配置
完整示例:
config.properties配置如下:
#mysql version database druid settingvalidationQuery=SELECT 1#mysqljdbc.publicKey=MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAJFVYHtEdFAJRZqY3fm4nbuQ6ZuRFi6to2hLkrnl5bWE7wGjDMHpKs8xkZk+rd7hGSbwqnWQ0Pc/PxEZDWGDA7ECAwEAAQ==jdbc.url=jdbc:mysql://192.168.0.10:3306/beatles?useUnicode=true&characterEncoding=utf-8&autoReconnect=truejdbc.username=rootjdbc.password=Hmf8zSyeYWlZa3ps3fq2W8jqexnoX15ItBoQyLsbdsKRFPMPliDAFEjxe67cK0VvjoT8S8m6EuzBJdDm+vIrxQ==#jdbc.publicKey=MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAIai8vnGOirb6G1LtRnw3pgnIEqrwAu/5CeNzlveAuy6PNieYnPCzm7CXapPxToQkeFAeyJhPZxh2Q0Bp9Go0gkCAwEAAQ==#jdbc.url=jdbc:mysql://211.149.149.227:3306/wjp_spa?useUnicode=true&characterEncoding=utf-8&autoReconnect=true#jdbc.username=jgrjb#jdbc.password=Ssn62wtvs0ShYuUnC3xZdjfjbLcRoSG9jzmO+2+YavBpAxcX9KdnlPiNFxn9N6ygjP0Zim1QYRM0L8JLdLtshA==page.pageSize=30