这是我第一次做一个简单的弹簧启动结块,我遇到了这个问题。
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我不知道如何解决我在驱动程序中添加的问题,但是我得到了错误,请解决这个问题
application.properties
spring.datasource.url=jdbc:mysql://localhost:3306/mlab
spring.datasource.username=root
spring.datasource.password=porm.xml
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>发布于 2020-09-17 08:31:44
看来你没能提供司机类的名字。
spring.datasource.url=jdbc:mysql://localhost:3306/mlab
spring.datasource.username=root
spring.datasource.password=
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver您可以参考:https://www.baeldung.com/spring-boot-failed-to-configure-data-source
在添加上述属性之后,它应该是工作的。
发布于 2020-09-17 08:34:48
您可以尝试在application.properties中添加驱动程序类。
spring.datasource.driver-class-name=com.mysql.jdbc.Driver您还可以根据需要添加以下内容并进行修改
spring.jpa.database-platform = org.hibernate.dialect.MySQL5Dialect
spring.jpa.generate-ddl=true
spring.jpa.hibernate.ddl-auto = updatehttps://stackoverflow.com/questions/63934096
复制相似问题