错误描述信息如下:
***************************
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).
原因是在你的项目中引入了JPA这个依赖:org.springframework.boot:spring-boot-starter-data-jpa,如果你不配置数据源就会报上面的错误。
解决办法一:配置数据源如下
# DataSource
spring.datasource.url=jdbc:mysql://localhost/数据库名称?characterEncoding=utf-8&useSSL=false&serverTimezone=UTC
spring.datasource.user