1 Add dependencies to the pom.xml configuration file in the project
<!--MySQL依赖 --> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-jdbc</artifactId> </dependency> <!--JPA依赖 --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-jpa</artifactId> </dependency> <!-- The following dependencies need to be imported to use @Entity annotation, @Id annotation --> < dependency > < groupId > javax.persistence </ groupId > < artifactId > persistence-api </ artifactId > < version > 1.0.2 < ersion > </ dependency >