在确认了实体类加上了正确的@Entity注解,并且项目也正常启动之后,百度了发现是yml文件配置格式出了问题,准确说是yml的层级结构问题。正确的配置应该是:
spring:
datasource:
driver-class-name: com.mysql.jdbc.Driver
url: jdbc:mysql://localhost:3306/mysqltest?useUnicode=true&characterEncoding=UTF8&useSSL=false
username: root
password: 123
jpa:
hibernate:
ddl-auto: update
database: mysql
show-sql: true
重新启动项目,就发现表已经建好了



