title: Unable to connect my spring boot application to mysql
body: <p>I have got this access denied exception :</p>
  
  <blockquote>
    <p>java.sql.SQLException: Access denied for user ''@'localhost' (using
    password: NO)
             org.springframework.jdbc.support.MetaDataAccessException: Could not get Connection for extracting meta-data; nested exception is
    org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to
    obtain JDBC Connection; nested exception is java.sql.SQLException:
    Access denied for user ''@'localhost' (using password: NO)
             018-08-23 00:55:21.791  INFO 1260 --- [           main] j.LocalContainerEntityManagerFactoryBean : Building JPA container
    EntityManagerFactory for persistence unit 'default' 2018-08-23
    00:55:21.813  INFO 1260 --- [           main]
    o.hibernate.jpa.internal.util.LogHelper  : HHH000204: Processing
    PersistenceUnitInfo [     name: default   ...] 2018-08-23 00:55:22.180 
    INFO 1260 --- [           main] org.hibernate.Version<br>
    : HHH000412: Hibernate Core {5.2.17.Final} 2018-08-23 00:55:22.181 
    INFO 1260 --- [           main] org.hibernate.cfg.Environment<br>
    : HHH000206: hibernate.properties not found 2018-08-23 00:55:22.221 
    INFO 1260 --- [           main] o.hibernate.annotations.common.Version
    : HCANN000001: Hibernate Commons Annotations {5.0.1.Final} 2018-08-23
    00:55:22.351  INFO 1260 --- [           main]
    com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Starting...
    2018-08-23 00:55:23.445 ERROR 1260 --- [           main]
    com.zaxxer.hikari.pool.HikariPool        : HikariPool-1 - Exception
    during pool initialization.</p>
  </blockquote>
  
  <p>application properties file:</p>
  
  <pre><code>    spring.thymeleaf.cache=false
  
      #===============================
      #DATA SOURCE
      #===============================
  
      #set here configurations for the database connection
  
      spring.datasource.url=jdbc:mysql://localhost:3306/bookstoredatabase?verifyServerCertificate=false&amp;useSSL=true
      #username and secret
      spring.datasource.data.username=root
      spring.datasource.data.password=
  
      #keep connection alive if idle for long time
      spring.datasource.testWhileIdle = true
      spring.datasource.validationQuery = SELECT 1
  
  
      #===================
      #jpa/hibernate
      #===================
      #use spring.jpa.properties.* for hibernate native properties
      #stripped before adding them to the entity manager
  
      #show or not log for each sql query
      spring.jpa.show-sql=true
  
      #jdbc driver class
      spring.datasource.driver-class-name=com.mysql.jdbc.Driver
  
      #the project
      spring.jpa.hibernate.ddl-auto=create
  
  
      #allows hibernate to generat sql optimised for particular dbms
      spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect
  </code></pre>
  
  <hr>
  
  <p>my java file:</p>
  
  <pre><code>package com.example.demo;
  
  import org.springframework.boot.SpringApplication;
  import org.springframework.boot.autoconfigure.SpringBootApplication;
  
  @SpringBootApplication
  public class BookstoreApplication {
  
      public static void main(String[] args) {
          SpringApplication.run(BookstoreApplication.class, args);
      }
  }
  </code></pre>