如何将SpringBoot应用程序与MySQL数据库连接?

时间:2018-12-08 08:59:08

标签: java maven spring-boot

我试图在application.properties中设置URL,但是出现此错误:

Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.

原因:无法确定合适的驱动程序类别

spring.datasource.url=jdbc:mysql://localhost:3306/springboot
spring.datasource.username=root
spring.datasource.password=root
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.jpa.database-platform=org.hibernate.dialect.MySQLDialect
spring.jpa.show-sql=false
spring.flyway.locations=classpath:db/mysql/migration

0 个答案:

没有答案