To work with Spring Data JPA, open your build.gradle and extend it:
... dependencies { ... runtime('mysql:mysql-connector-java') compile("org.springframework.boot:spring-boot-starter-data-jpa") ... }
We have provided the necessary dependencies and we have also added support for MySQL connector and Spring Data JPA. Next, what we need to do is to define our data source. Open the application.properties file and add configuration according to your local MySQL instance:
spring.datasource.url=jdbc:mysql://localhost/journaler_api?useSSL=false&useUnicode=true&characterEncoding=utf-8 spring.datasource.username=root spring.datasource.password=YOUR_MYSQL_ROOT_PASSWORD spring.datasource.tomcat.test-on-borrow=true spring.datasource.tomcat.validation-interval=30000 ...