弹簧2.6.7:无法配置数据源:' url'属性
我创建了一个新的弹簧启动项目,并在应用程序中指定了。专业DB设置:
spring.jpa.hibernate.ddl-auto=update
spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect
spring.datasource.url=jdbc:mysql://localhost:3306/mydb?&useLegacyDatetimeCode=false&serverTimezone=UTC&useUnicode=yes&character_set_server=utf8mb4
spring.datasource.username=.....
spring.datasource.password=.....
在pom.xml中,我有mysql依赖关系:
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
我也完成了maven-&gt;更新
....
启动项目时,控制台说:
***************************
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
我不理解..我只是提供了他需要的东西... datasource.url ...
当我将弹簧版更改为时2.3.0.Release
...它有效。但是,为什么不使用新的2.6.7
(应该稳定)呢?
I have created a new Spring Starter Project and I specified in application.properties the db settings:
spring.jpa.hibernate.ddl-auto=update
spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect
spring.datasource.url=jdbc:mysql://localhost:3306/mydb?&useLegacyDatetimeCode=false&serverTimezone=UTC&useUnicode=yes&character_set_server=utf8mb4
spring.datasource.username=.....
spring.datasource.password=.....
in pom.xml I have the mysql dependency:
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
I have also done maven -> Update
....
When starting the project the console says:
***************************
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
I don´t understand..i just provided what he needs...the datasource.url...
When I change the spring version to 2.3.0.RELEASE
...it works. But why not with the newer one 2.6.7
(which should be stable)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论