启动异常
***************************
APPLICATION FAILED TO START
***************************
Description:
Failed to configure a DataSource: 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).
---------------------------------------------------------------------
以上是报错信息. 我看了网上什么转义,都不对....后来知道....yml.中 DataSource 是属于 spring 的下一级.所以 yml 格式造成的.
正确配置
如果你的项目中没有 mybatis
那么可能是由于
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-jdbc</artifactId> </dependency>
这个依赖导致的