Failed to configure a DataSource: ‘url‘ attribute is not specified and no embedded datasource could

末蓝、 2024-04-29 11:13 172阅读 0赞

1.报错示例Failed to configure a DataSource: ‘url’ attribute is not specified and no embedded datasource could be configured.

fcbf062ae09248e781709aa62dd9377f.png

2.报错原因

表示数据库的配置信息里面没有配置url

3.解决办法

在配置文件application.properties中加上如下代码

  1. spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
  2. spring.datasource.url=jdbc:mysql://127.0.0.1:3306/bank?useSSL=true&useUnicode=true&characterEncoding=utf8
  3. spring.datasource.username=root
  4. spring.datasource.password=123456

729d34ac6e0b4e939c5700c0b745de25.png

发表评论

表情:
评论列表 (有 0 条评论,172人围观)

还没有评论,来说两句吧...

相关阅读