1
0
Code Issues Pull Requests Packages Projects Releases Wiki Activity GitHub Gitee
epp/Solutions.md

37 lines
1.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

## 遇到的问题及对应的解决方案
### 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
```