通过spring引入外部properties数据库配置文件,使用spel表达式读取配置文件中数据库username的值,数据库连接报错
imageimage

配置文件中设置的用户名是root,但实际获取到的是主机名。

解决方法

1、修改配置文件中的key,避免与系统当前用户的username冲突
image
2、用本地配置覆盖系统的配置
logcal-override="true"
image.png


Songyf
4 声望0 粉丝

码帝