让我们以 MySQL 为例来思考这个问题:
欢迎大家加我qq:1038774626探讨技术问题。
<dependency> ????<groupId>mysql</groupId> ????<artifactId>mysql-connector-java</artifactId></dependency>
或者至少把它作为测试的范围。
<!-- <dependency> ????<groupId>com.h2database</groupId> ????<artifactId>h2</artifactId> <scope>test</scope> </dependency> -->
更多的来看看这里 -https://github.com/in28minutes/jpa-with-hibernate#installing-and-setting-up-mysql
配置 application.properties
spring.jpa.hibernate.ddl-auto=none spring.datasource.url=jdbc:mysql://localhost:3306/todo_examplespring.datasource.username=todouser spring.datasource.password=YOUR_PASSWORD