请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

无法生成对应得数据库表

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

正在回答 回答被采纳积分+3

1回答

老实憨厚的虎虎 2019-07-15 11:03:28

先看错误信息:

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 回复 有任何疑惑可以回复我~
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信