The server time zone value ‘锟叫癸拷锟斤拷\u05FC时锟斤拷‘ is unrecognized or represents more than one time zone

本文涉及的产品
RDS MySQL Serverless 基础系列,0.5-2RCU 50GB
云数据库 RDS MySQL,集群系列 2核4GB
推荐场景:
搭建个人博客
云数据库 RDS PostgreSQL,集群系列 2核4GB
简介: The server time zone value ‘锟叫癸拷锟斤拷\u05FC时锟斤拷‘ is unrecognized or represents more than one time zone

一、项目场景

今天用mysql给elaticsearch,报了一个很奇怪的error, 如下:

The server time zone value '锟叫癸拷锟斤拷\u05FC时锟斤拷' is unrecognized or represents more than one time zone.


二、问题描述

他说不能识别时区,由于视频老师的mysq版本是mysql 5.7,所以引发了我对版本不一样导致报错的思考!!!

2018122814580746.png


三、解决方案

查看之后才发现,原来jdbc连接mysql 8.0的时候,需要指定时区,即在数据库名字后面添加serverTimezone=UTC,如下:

  jdbc_connection_string => "jdbc:mysql:///news&serverTimezone=UTC"

2018122814580746.png

这样子就可以顺利连接上了,特此记录一下。

四、tips

特提供一下mysql连接es的脚本文件写法:

input {
    jdbc {
        jdbc_driver_library => "D:\mysql-connector-java-8.0.21.jar"
        jdbc_driver_class => "com.mysql.cj.jdbc.Driver"
        jdbc_connection_string => "jdbc:mysql:///news&serverTimezone=UTC"
        jdbc_user => "root"
        jdbc_password => "123456"
        schedule => "* * * * *"
        statement => "SELECT * FROM news;"
    }
}
filter {
  mutate {
    split => {"tags" => ","}
  }
}
output {
    elasticsearch {
    hosts => ["120.79.50.65:9200","120.79.50.65:9201","120.79.50.65:9202"]
        index => "news"
        document_id => "%{id}"
    }
}

感兴趣的小伙伴,关注下,感谢支持

相关实践学习
如何在云端创建MySQL数据库
开始实验后,系统会自动创建一台自建MySQL的 源数据库 ECS 实例和一台 目标数据库 RDS。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助     相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
相关文章
|
5月前
|
Java 数据库连接 数据库
The server time zone value ‘Öйú±ê׼ʱ¼ä‘ is unrecognized or represents more than one time zone
The server time zone value ‘Öйú±ê׼ʱ¼ä‘ is unrecognized or represents more than one time zone
33 0
|
Java 关系型数据库 MySQL
The server time zone value ‘?й???’ is unrecognized or represents more than one time zone. You must c
报错信息如下:The server time zone value ‘?й???’ 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.
82 0
|
5月前
|
测试技术
Could not proxy command to the remote server. Original error: timeout of 240000ms exceeded 的解决办法
Could not proxy command to the remote server. Original error: timeout of 240000ms exceeded 的解决办法
220 0
|
5月前
|
数据库连接
数据库连接的时区问题 The server time zone value is unrecognized
数据库连接的时区问题 The server time zone value is unrecognized
62 0
|
关系型数据库 MySQL Java
超详解The server time zone value ‘�й���׼ʱ��‘ is unrecognized or represents more than one time zone
超详解The server time zone value ‘�й���׼ʱ��‘ is unrecognized or represents more than one time zone
581 0
|
数据库连接 数据库
The server time zone value ‘‘ is unrecognized or represents more than one time zone.
The server time zone value ‘‘ is unrecognized or represents more than one time zone.
|
关系型数据库 MySQL Java
The server time zone value '?й???????' is unrecognized or represents more than one time zone.
The server time zone value '?й???????' is unrecognized or represents more than one time zone.
87 0
The server time zone value '?й???????' is unrecognized or represents more than one time zone.
|
Java 关系型数据库 MySQL
mybatis学习(8):The server time zone value ‘???ú±ê×??±??‘ is unrecognized or represents more
mybatis学习(8):The server time zone value ‘???ú±ê×??±??‘ is unrecognized or represents more
166 0
mybatis学习(8):The server time zone value ‘???ú±ê×??±??‘ is unrecognized or represents more
|
Java 数据库连接 数据库
The sever time reprents more than one tie zoe.
The sever time reprents more than one tie zoe.
128 0
|
Java 数据库连接
JDBC - The server time zone value ‘???‘ is unrecognized or represents more than one time zone
JDBC - The server time zone value ‘???‘ is unrecognized or represents more than one time zone
97 0