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

原创
2019/10/14 23:00
阅读数 377

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 01S00

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.

出现这种问题还是版本更细,与其他版本造成    

显示新版本的数据库连接程序需要指定UTC时区,改正方法将配置文件中的“url”后面加上指定的时区,将其值改为“url=jdbc:mysql://localhost:3306/db&serverTimezone=GMT”

改之前:


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\=true


改之后:


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
 

展开阅读全文
打赏
0
0 收藏
分享
加载中
更多评论
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部