在使用 Spring Data 测试进行数据查询的时候提示错误: Caused by: org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set 问题和解决 一般来说这个问题的出现是在你的 Spring Boot 项目中的 application.properties 没有设置 spring.jpa.database-platform 这个参数。通常来说这个参数用于告诉 JPA 应该适配何种数据库。 一般来说配置的参数为: spring.jpa.database-platform=org.hibernate.dialect.MariaDBDialect 在 org.hibernate.dialect 后面需要适配你希望使用的数据库类型。可以使用的数据库类型可以自行通过 Google 来进行搜索。 这个配置类型在 Hibernate 的 API 中说明,具体的说明连接请参考不同的 Hibernate 版本。我们在这里找了一个版本:org.hibernate.dialect (Hibernate JavaDocs) 例如,如果你希望适配 Mariadb 的话。 根据上面的配置页面来进行设置,那么设置的参数应该为: spring.jpa.database-platform=org.hibernate.dialect.MariaDBDialect 当设置好后重新进行测试,应该就不会提示有上面的错误了。 https://www.ossez.com/t/spring-data-hibernate-dialect/13207