title: Using mysql connectivity in Spring boot with gradle via JPA and hibernate
body: <p>Using mysql connectivity in Spring boot with gradle via JPA and hibernate. Using mysql 8 version.</p>
  
  <p>While connecting mysql via spring boot jpa i'm getting following exception</p>
  
  <p><a href="https://i.stack.imgur.com/skebn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/skebn.png" alt="enter image description here"></a></p>
  
  <p>I have added everything in gradle and property file.
  Following is my application.properties file</p>
  
  <pre><code>spring.mvc.view.prefix:/WEB-INF/jsp/
  spring.mvc.view.suffix:.jsp
  server.port=8081
  spring.jpa.hibernate.ddl-auto=update
  spring.datasource.url=jdbc:mysql://localhost:3306/tes?autoReconnect=true&amp;useSSL=false
  spring.datasource.username=root
  spring.datasource.password=******
  spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect
  spring.jpa.show-sql=true
  spring.datasource.testWhileIdle = true
  spring.datasource.validationQuery = SELECT 1
  </code></pre>
  
  <p>This is my build gradle file</p>
  
  <pre><code>buildscript {
  ext {
      springBootVersion = '1.4.3.RELEASE'
  }
  repositories {
      mavenCentral()
  }
  dependencies {
      classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
  }
  }
  
  apply plugin: 'java'
  apply plugin: 'eclipse'
  apply plugin: 'org.springframework.boot'
  
  jar {
   baseName = 'boot-gradle'
   version = '0.0.1-SNAPSHOT'
  }
  sourceCompatibility = 1.8
  targetCompatibility = 1.8
  
  repositories {
    mavenCentral()
  }
  
  
  dependencies {
  compile('org.springframework.boot:spring-boot-starter-web','org.apache.tomcat.embed:tomcat-embed-jasper'
  ,'javax.servlet:jstl')
  compile("org.springframework.boot:spring-boot-starter-data-jpa")
  compile("com.h2database:h2")
  compile("mysql:mysql-connector-java")
  testCompile('org.springframework.boot:spring-boot-starter-test')
  testCompile("junit:junit")
  }
  </code></pre>