spring boot启动报错Error starting ApplicationContext(未能配置数据源)

主要错误:

Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.

未能配置数据源:未指定“url”属性,也无法配置嵌入式数据源。

主要原因

  不小心把yaml配置创建在templates下

  

处理结果;

  把yaml导到resources目录下

然后运行成功

总结:这个错误主要是application.yaml配置找不到,也就无法配置数据源,加载里面的数据。

原文地址:https://www.cnblogs.com/Spring-M/p/12706468.html