1)pom.xml添加MySQL,spring-data-jpa依赖
mysqlmysql-connector-java
org.springframework.bootspring-boot-starter-data-jpa
2)在application.properties文件中配置MySQL连接配置文件
########################################################
###datasource
########################################################
spring.datasource.url = jdbc:mysql://localhost:3306/test
spring.datasource.username = root
spring.datasource.password = root
spring.datasource.driverClassName = com.mysql.jdbc.Driver
spring.datasource.max-active=20
spring.datasource.max-idle=8
spring.datasource.min-idle=8
spring.datasource.initial-size=10
3)在application.properties文件中配置JPA配置信息
########################################################
### Java Persistence Api
#####################################################