2022-04-24 08:44

springboot启动失败 'hibernate.dialect' not set

王姐姐

JavaEE

(1717)

(0)

收藏

我用的SpringBoot2.6.6,使用SpringDataJPA操作数据库,一般启动没有问题,但是偶尔会报个错误启动不起来:

Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set

这是因为没有设置Hibernate SQL方言导致的,在properties文件中增加下面这行就可以了:

spring.jpa.database-platform=org.hibernate.dialect.MySQLDialect


Hibernate SQL方言:

DB2:org.hibernate.dialect.DB2Dialect
DB2  AS/400:org.hibernate.dialect.DB2400Dialect
DB2  OS390:org.hibernate.dialect.DB2390Dialect
PostgreSQL : org.hibernate.dialect.PostgreSQLDialect
MySQL:  org.hibernate.dialect.MySQLDialect
MySQL with InnoDB:  org.hibernate.dialect.MySQLInnoDBDialect
MySQL with MyISAM : org.hibernate.dialect.MySQLMyISAMDialect
Oracle (any version):org.hibernate.dialect.OracleDialect
Oracle 9i/10g:org.hibernate.dialect.Oracle9Dialect
Sybase:org.hibernate.dialect.SybaseDialect
Sybase: Anywhereorg.hibernate.dialect.SybaseAnywhereDialect
Microsoft SQL Server:org.hibernate.dialect.SQLServerDialect
SAP DB:org.hibernate.dialect.SAPDBDialect
Informix:org.hibernate.dialect.InformixDialect
HypersonicSQL:org.hibernate.dialect.HSQLDialect
Ingres:org.hibernate.dialect.IngresDialect
Progress:org.hibernate.dialect.ProgressDialect
Mckoi SQL:org.hibernate.dialect.MckoiDialect
Interbase:org.hibernate.dialect.InterbaseDialect
Pointbase:org.hibernate.dialect.PointbaseDialect
FrontBase:org.hibernate.dialect.FrontbaseDialect
Firebird:org.hibernate.dialect.FirebirdDialect


0条评论

点击登录参与评论