在application.yml中添加:
jpa: show-sql: true properties: hibernate: format_sql: true #格式化SQL,如果不加,SQL输出不换行,不方便查看 在application.properties中添加:
spring.jpa.show-sql=true spring.jpa.properties.hibernate.format_sql=true