本文仅供新手学习时参考避坑
错误代码:
ailed to configure a DataSource: ‘url’ attribute is not specified and no embedded datasource could be configured.
***************************
APPLICATION FAILED TO START
***************************
Description:
Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
Reason: Failed to determine a suitable driver class
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).
错误说明:
没有配置数据源,即没有配置数据库连接相关参数
过程及原因分析:
我在练习的时候,在pom.xml文件中添加了mysql和mybatis的依赖,重启springboot的时候就会报这个错。
解决方法:
删除相关依赖,然后重新加载Maven依赖
本文介绍了一种常见的SpringBoot应用程序启动失败的情况:未能正确配置数据源导致的问题。具体表现为未指定URL属性且未配置嵌入式数据库。文章提供了可能的原因分析及解决步骤。
6022

被折叠的 条评论
为什么被折叠?



