2021-08-15最新的spring boot,JPA+mysql,出現這個錯誤:
Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set。
百度了好一會,發現好多人說要在application.properties里加入以下這句:
spring.jpa.database-platform=org.hibernate.dialect.MySQLDialect
結果就是我加了這行也沒用,還是報同樣的錯。
后面切換到bing搜了一下英文站,去了stackoverflow:
java - Spring Boot JPA - Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set - Stack Overflow
分分鍾解決戰斗:
雖然我這里想使用的是mysql,不是PostgreSQL,那就換成mysql的嘛:
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQLDialect
對於百度搜出來的東西,再次持懷疑態度。
以上,僅記錄。