未能配置数据源:';url';未指定属性,并且无法使用Spring、MySql和Gradle配置嵌入式数据源

未能配置数据源:';url';未指定属性,并且无法使用Spring、MySql和Gradle配置嵌入式数据源,mysql,spring,spring-boot,Mysql,Spring,Spring Boot,我正在使用SpringBoot和MySql。启动应用程序时,出现以下错误: *************************** APPLICATION FAILED TO START *************************** Description: Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured

我正在使用SpringBoot和MySql。启动应用程序时,出现以下错误:

***************************
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


Action:

Consider the following:
    If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
    If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).
应用程序属性

spring.datasource.url=jdbc:mysql://localhost:3306/*****
spring.datasource.username=username
spring.datasource.password=password
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
build.gradle

dependencies {
      classpath "org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}"
      classpath "mysql:mysql-connector-java:$sqlClientVersion"
  }

dependencies {
    implementation 'mysql:mysql-connector-java:8.0.20'
}

如果有任何帮助,我们将不胜感激

驱动程序类名中还有cj extra。而且url也有******,指定合适的url主机:port/dbname,为什么是****?-进行这些更改并重试—MySQL Connector/J中实现java.sql.Driver的类的名称已从com.MySQL.jdbc.Driver更改为com.MySQL.cj.jdbc.Driver。旧类名已被弃用。****用于表示我不想公开的模式名称。谢谢这里是cj额外的驱动程序类名。而且url也有******,指定合适的url主机:port/dbname,为什么是****?-进行这些更改并重试—MySQL Connector/J中实现java.sql.Driver的类的名称已从com.MySQL.jdbc.Driver更改为com.MySQL.cj.jdbc.Driver。旧类名已被弃用。****用于表示我不想公开的模式名称。非常感谢。