1.异常错误:
2.错误分析
错误原因:Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.(无法配置DataSource:未指'url'属性,也无法配置嵌入数据源)
3.解决方案
在项目中添加resources,具体操作如下图所示:
添加好resources后,到之前创建的spring项目中将application.properties复制过来,如下图:
然后在application.properties中配置spring-datasource-url,spring-datasource-url,spring-datasource-password,连接自己的数据库,如下图: