Failed to configure a DataSource: ‘url‘ attribute is not specified and no embedded datasource could
Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could
·
异常产生环境
Spring Boot工程配置数据源启动时产生
异常描述
Description:
Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
Reason: Failed to determine suitable jdbc url
Action:
Consider the following:
If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).
异常原因
在yml文件配置数据源的连接信息时,把数据源的连接信息配置错误导致异常产生。由于idea工具多选了hikari这个节点导致的。

解决办法
把配置数据源的代码改正即可
改正前
改正后
更多推荐




所有评论(0)