1
0
Code Issues Pull Requests Packages Projects Releases Wiki Activity GitHub Gitee

记录遇到的问题及对应的解决方案

This commit is contained in:
程序员小墨 2022-10-21 01:21:21 +08:00
parent 42852f150a
commit b6cf527080
2 changed files with 36 additions and 5 deletions

36
Solutions.md Normal file
View File

@ -0,0 +1,36 @@
## 遇到的问题及对应的解决方案
### 2022.10
#### 2022.10.21 项目创建后启动失败提示Failed to configure a DataSource: url attribute is not specified and no embedded datasource could be configured.
```bash
***************************
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).
```
解决方案:
application.properties 配置文件中添加数据库配置
```bash
# MySQL配置
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/epp?useUnicode=true&characterEncoding=utf8&useSSL=false
spring.datasource.username=root
spring.datasource.password=root
```

View File

@ -25,11 +25,6 @@
<version>2.7.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jdbc</artifactId>
<version>2.7.4</version>
</dependency>
<!-- Database -->