title: Cant access mysql in spring-boot
body: <p>i cant access mysql using JPA in spring-boot</p>
  
  <p>I am new to spring-boot and spring.</p>
  
  <p>the error i got is below </p>
  
  <pre><code>Description:
  
  Parameter 0 of constructor in org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration required a bean of type 'javax.sql.DataSource' that could not be found.
  
      - Bean method 'dataSource' not loaded because @ConditionalOnProperty (spring.datasource.jndi-name) did not find property 'jndi-name'
  
      - Bean method 'dataSource' not loaded because @ConditionalOnBean (types: org.springframework.boot.jta.XADataSourceWrapper; SearchStrategy: all) did not find any beans
  Action:
  Consider revisiting the conditions above or defining a bean of type 'javax.sql.DataSource' in your configuration.
  </code></pre>
  
  <p>My application.properties file has below lines</p>
  
  <pre><code>spring.datasource.driver-class-name=com.mysql.jdbc.Driver
  spring.datasource.url=jdbc:mysql://localhost:3306/mydatabase
  spring.datasource.username=root
  spring.datasource.password=mypassword
  spring.jpa.database-platform=org.hibernate.dialect.MySQL5Dialect
  spring.jpa.show-sql=true
  spring.jpa.hibernate.ddl-auto=update
  </code></pre>
  
  <p>Looking at at error what I could think is spring-boot is complaining that I didn't set (spring.datasource.jndi-name) property..... which I think is not necessary as I have given datasource url &amp; credentials for login.</p>
  
  <p>I dont know what value I should give to <strong>spring.datasource.jndi-name</strong>.</p>
  
  <p>I appreciate any help. I am struck at this.</p>