我有:
spring.datasource.driverClassName = com.mysql.cj.jdbc.Driver
spring.datasource.url=jdbc:mysql://localhost:3306/test?serverTimezone=Europe/Madrid
spring.datasource.username=root
spring.datasource.password=secret
spring.jpa.hibernate.ddl-auto=update而且效果很好。
但当我试图这样做的时候:
spring:
datasource:
driverClassName: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/test?serverTimezone=Europe/Madrid
username: root
password: secret
jpa:
hibernate:
ddl-auto: update它失败了,因为:
Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.我认为这是一个愚蠢的语法错误,但我没有注意到它在哪里。
发布于 2020-01-07 21:58:59
如果要使用YAML语法,则需要通过将文件名从application.properties更改为application.yml来指定它。
发布于 2020-01-07 21:58:49
是非常敏感的。确保你:
application.yml
https://stackoverflow.com/questions/59636613
复制相似问题