无法生成对应得数据库表

来源:6-1 关于红包收发之操作数据库(上)

qq_十号风球_1

2019-07-13

无法生成相应的数据库表
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).

Process finished with exit code 1

写回答

1回答

老实憨厚的虎虎

2019-07-15

先看错误信息:

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

大概意思就是你的数据库出问题了。连接url写错了。

spring:
 datasource:
   driver-class-name: com.mysql.cj.jdbc.Driver
   url: jdbc:mysql://localhost:3306/luckymoney?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC
   username: root
   password: root

这个是我的配置,在application.yml里,需要检查的是 driver-class-name: com.mysql.cj.jdbc.Driver是否引错了,然后是url 注意斜杠和反斜杠,有的时候会发生斜杠需要转义的操作,具体请百度。格式需要严格按照上面的来

0
0

2小时快速上手Spring Boot

一切为了效率!两个小时学习SpringBoot,为你省时省力Get干货

11582 学习 · 249 问题

查看课程