The server time zone value 'EDT' is unrecognized or represents more than one time zone.

2019-10-14 18:07:43.714 ERROR 74363 --- [Druid-ConnectionPool-Create-1855026648] com.alibaba.druid.pool.DruidDataSource   : create connection SQLException, url: jdbc:mysql://10.30.244.229:3306/acsdb?dontTrackOpenResources=true&useUnicode=true&characterEncoding=utf8, errorCode 0, state 01S00java

java.sql.SQLException: The server time zone value 'EDT' 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.mysql

出現這種問題仍是版本更細,與其餘版本形成    linux

顯示新版本的數據庫鏈接程序須要指定UTC時區,改正方法將配置文件中的「url」後面加上指定的時區,將其值改成「url=jdbc:mysql://localhost:3306/db&serverTimezone=GMT」redis

改以前:spring


mss@linux-ozm7:~/cache> cat acs_env_cache.properties
#cache properties from center.
#Mon Oct 14 18:51:00 EDT 2019
gis.datasource.gpsdb.username=root
gis.datasource.acsdb.password=acsAdmin@2018
spring.kafka.bootstrap-servers=10.30.244.229\:10180
logging.config=classpath\:config/logback-file.xml
gis.datasource.gpsdb.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.url=jdbc\:mysql\://10.30.244.229\:3306/acsdb?dontTrackOpenResources\=true&useUnicode\=true
gis.datasource.acsdb.type=com.alibaba.druid.pool.DruidDataSource
gis.datasource.acsdb.username=root
spring.datasource.password=acsAdmin@2018
gis.datasource.gpsdb.type=com.alibaba.druid.pool.DruidDataSource
spring.redis.password=Allcam@2018
gis.datasource.gpsdb.password=acsAdmin@2018
gis.datasource.acsdb.url=jdbc\:mysql\://10.30.244.229\:3306/acsdb?dontTrackOpenResources\=true&useUnicode\=true
spring.datasource.username=root
spring.redis.port=10170
dubbo.registry.address=zookeeper\://10.30.244.229\:10190
spring.redis.host=10.30.244.229
gis.datasource.acsdb.driver-class-name=com.mysql.jdbc.Driver
gis.datasource.gpsdb.url=jdbc\:mysql\://10.30.244.229\:3306/gisdb?dontTrackOpenResources\=true&useUnicode\=truesql


改以後:數據庫


mss@linux-ozm7:~/cache> cat acs_env_cache.properties
#cache properties from center.
#Mon Oct 14 18:51:00 EDT 2019
gis.datasource.gpsdb.username=root
gis.datasource.acsdb.password=acsAdmin@2018
spring.kafka.bootstrap-servers=10.30.244.229\:10180
logging.config=classpath\:config/logback-file.xml
gis.datasource.gpsdb.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.url=jdbc\:mysql\://10.30.244.229\:3306/acsdb?dontTrackOpenResources\=true&useUnicode\=true&characterEncoding\=utf8&serverTimezone\=GMT
gis.datasource.acsdb.type=com.alibaba.druid.pool.DruidDataSource
gis.datasource.acsdb.username=root
spring.datasource.password=acsAdmin@2018
gis.datasource.gpsdb.type=com.alibaba.druid.pool.DruidDataSource
spring.redis.password=Allcam@2018
gis.datasource.gpsdb.password=acsAdmin@2018
gis.datasource.acsdb.url=jdbc\:mysql\://10.30.244.229\:3306/acsdb?dontTrackOpenResources\=true&useUnicode\=true&characterEncoding\=utf8&serverTimezone\=GMT
spring.datasource.username=root
spring.redis.port=10170
dubbo.registry.address=zookeeper\://10.30.244.229\:10190
spring.redis.host=10.30.244.229
gis.datasource.acsdb.driver-class-name=com.mysql.jdbc.Driver
gis.datasource.gpsdb.url=jdbc\:mysql\://10.30.244.229\:3306/gisdb?dontTrackOpenResources\=true&useUnicode\=true&characterEncoding\=utf8&serverTimezone\=GMT
 bootstrap

相關文章
相關標籤/搜索