Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'hibernate.dialect' not set #1065

Closed
liangjf85 opened this issue Apr 19, 2018 · 9 comments
Closed

'hibernate.dialect' not set #1065

liangjf85 opened this issue Apr 19, 2018 · 9 comments

Comments

@liangjf85
Copy link

0.10.2版本编译启动会出现Caused by: org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set错误

需要手工配置-Dspring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect

建议框架优化,内部默认配置

@nobodyiam
Copy link
Member

这个错是spring boot推断数据库类型失败了,一般是由于数据库地址配置不正确导致的,如果配置的是jdbc:mysql://xxx的话,是能推断出来的。

@ghost
Copy link

ghost commented Jul 15, 2018

mysql 8.0版本 出现了同样的问题,jdbc串是正确的apollo_config_db_url=jdbc:mysql://192.168.2.50:3306/ApolloConfigDB?characterEncoding=utf8 apollo_config_db_username=writeuser apollo_config_db_password=TestNV7786!

@nobodyiam
Copy link
Member

mysql 8.0需要用最新的master代码,后续会在0.11.0发布支持,详见 #1147

@nobodyiam
Copy link
Member

0.11.0版本已经发布,详见Release Notes

case先关闭了,如还有问题,可以提供更多信息,或进群交流。

@zhengm-hub
Copy link

zhengm-hub commented Apr 17, 2019

Caused by: org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set
// apollo-configservice-1.3.0-github.zip
// mysql 8
// configservice
spring.datasource.url=jdbc:mysql://localhost:3306/ApolloConfigDB?useSSL=false&characterEncoding=utf8
spring.datasource.username=root
spring.datasource.password=root

@nobodyiam
Copy link
Member

看第一个报错信息吧,下面这个不是root cause

Caused by: org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set

@andylauxugang2
Copy link

以上根本没有解决,原因是因为没有 ApolloPortalDB 数据库:

CREATE DATABASE IF NOT EXISTS ApolloPortalDB default charset utf8mb4 COLLATE utf8mb4_general_ci;

@Anilople
Copy link
Contributor

补充一种情况,

错误信息

Caused by: com.mysql.cj.exceptions.InvalidConnectionAttributeException: The server time zone value 'PDT' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.

只要添加serverTimezone即可

spring.datasource.url=jdbc:mysql://localhost:3306/ApolloPortalDB?characterEncoding=utf8

变成

spring.datasource.url=jdbc:mysql://localhost:3306/ApolloPortalDB?characterEncoding=utf8&serverTimezone=UTC

不一定要用UTC

@linception
Copy link

我在 spring.datasource.url 加上 &useSSL=false 就行了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants