title: Gradle project --Failed to configure a DataSource'url' attribute is not specified and no embedded datasource could be configured
body: <p>Tried to follow the guide in <a href="https://spring.io/guides/gs/accessing-data-mysql/" rel="nofollow noreferrer">https://spring.io/guides/gs/accessing-data-mysql/</a> , however when i launch my java application, it shows error of:</p>
  
  <pre><code>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).
  </code></pre>
  
  <p>Here is my application.property:</p>
  
  <pre><code>spring.jpa.hibernate.ddl-auto=create
  spring.datasource.url=jdbc:mysql://localhost:3306/db_currency
  spring.datasource.username=springuser
  spring.datasource.password=ThePassword
  </code></pre>
  
  <p>The database creation followed the guide that:</p>
  
  <pre><code>mysql&gt; create database db_example; -- Create the new database
  mysql&gt; create user 'springuser'@'localhost' identified by 'ThePassword'; 
  mysql&gt; grant all on db_example.* to 'springuser'@'localhost';
  </code></pre>
  
  <p>And my build.gradle is:</p>
  
  <pre><code>buildscript {
      repositories {
          mavenCentral()
      }
      dependencies {
          classpath("org.springframework.boot:spring-boot-gradle-plugin:2.0.5.RELEASE")
      }
  }
  
  apply plugin: 'java'
  apply plugin: 'eclipse'
  apply plugin: 'idea'
  apply plugin: 'org.springframework.boot'
  apply plugin: 'io.spring.dependency-management'
  
  bootJar {
      baseName = 'gs-accessing-data-mysql'
      version =  '0.1.0'
  }
  
  repositories {
      mavenCentral()
  }
  
  sourceCompatibility = 1.8
  targetCompatibility = 1.8
  
  dependencies {
      compile("org.springframework.boot:spring-boot-starter-web")
  
      // JPA Data (We are going to use Repositories, Entities, Hibernate, etc...)
      compile 'org.springframework.boot:spring-boot-starter-data-jpa'
  
      // Use MySQL Connector-J
      compile 'mysql:mysql-connector-java'
  
      testCompile('org.springframework.boot:spring-boot-starter-test')
  }
  </code></pre>