当前位置:网站首页>tidb-cdc创建任务报错 Unknown or incorrect time zone
tidb-cdc创建任务报错 Unknown or incorrect time zone
2022-06-11 17:19:00 【与数据交流的路上】
一、报错详情
fail to open MySQL connection: [CDC:ErrMySQLConnectionError]Error 1298: Unknown or incorrect time zone: 'Asia/Shanghai'
二、排查
# 登陆tidb,查看时区
show variables like '%time_zone%';
+------------------+---------------+
| Variable_name | Value |
+------------------+---------------+
| system_time_zone | Asia/Shanghai |
| time_zone | SYSTEM |
+------------------+---------------+
# 登陆mysql,查看时区
show variables like '%time_zone%';
+------------------+--------+
| Variable_name | Value |
+------------------+--------+
| system_time_zone | CST |
| time_zone | SYSTEM |
+------------------+--------+
这里可以发现上游tidb的时区为Asia/Shanghai,而下游mysql的时区为CST
三、解决办法
办法一、加载时区
mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root mysql -p
办法二、将sink写上下游时区
cdc cli changefeed create --sink-uri="mysql://user:[email protected]_ip:mysql_port/?time-zone=CST" --pd=http://pd_ip:pd_port
官方文档:文档地址
边栏推荐
猜你喜欢
![[online problem] timeout waiting for connection from pool](/img/f0/7e8444ed7d0921b98d5e998e274bc8.png)
[online problem] timeout waiting for connection from pool

Leetcode力扣刷题

How to become an optimist organization?

Sohu tout le personnel a été escroqué, quels problèmes ont été exposés?

What problems are exposed when all Sohu employees are cheated?

GUI guess number game, directly open play

Authoring share | understanding saml2 protocol

Docker安装mysql5.7(开启binlog功能、修改字符)

From manufacturing to "intelligent manufacturing", explore the way for manufacturing enterprises to break the situation

拜登下令强制推行零信任架构
随机推荐
which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_ mod
Authing CEO 谢扬入选福布斯 2021 年 30 Under 30 亚洲榜单
搜狐全员遭诈骗,暴露哪些问题?
Computing philosophy behind authoring
Science popularization genius on the left, madman on the right
Authing 背后的计算哲学
Authing biweekly news: online application market (5.10-5.22)
6-8 有结构文件的读写1
Automated testing selenium
vscode配置eslint自动格式化报错“Auto Fix is enabled by default. Use the single string form“
6-3 批量求和(*)
活动 | Authing 首次渠道合作活动圆满落幕
TestPattern error
Remove key lookup bookmark from SQL Server
Docker installs mysql5.7 (enable binlog function and modify characters)
Authing Share|理解 SAML2 协议
导出数据提示--secure-file-priv选项问题的解决方法
Song of the sea in 5g Era
04_特征工程—特征选择
Guide to Dama data management knowledge system: percentage of chapter scores