本文仅供新手学习时参考避坑
错误代码:
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依赖