首页 > 解决方案 > 如何将我的 SpringBoot 应用程序与 MySQL 数据库连接?

问题描述

我尝试在 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

标签: javamavenspring-boot

解决方案


推荐阅读