当前位置:网站首页>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
官方文档:文档地址
边栏推荐
- which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mod
- Chip mass production, oppo entering a new era?
- What problems are exposed when all Sohu employees are cheated?
- Char array parsing
- Haas, which integrates relevant technologies of Alibaba cloud, Dharma Institute and pingtouge, has officially announced the book
- Error: error summary of pointer as function parameter
- 7-2 h0107. Pig-Latin
- which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_ mod
- From manufacturing to "intelligent manufacturing", explore the way for manufacturing enterprises to break the situation
- Authing 背后的计算哲学
猜你喜欢

vscode保存代码时自动eslint格式化

【Mysql】redo log,undo log 和binlog详解(四)

Use of forcescan in SQL server and precautions

Authing biweekly news: authing forum launched (4.25-5.8)

which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_ mod

A journey of database full SQL analysis and audit system performance optimization

Read and understand the development plan for software and information technology service industry during the "14th five year plan"

Leetcode force deduction question

GUI guess number game, directly open play

Global and China Mobile Network Optimization (MnO) industry development panoramic survey and Investment Strategy Research Report 2022-2028
随机推荐
Centos7 server configuration (IV) -- installing redis
Go get downloaded package path
threejs中设置物体的贴图+场景的6面贴图 +创建空间
sql server中移除key lookup书签查找
Vscode configures eslint to automatically format with an error "the setting is deprecated. use editor.codeactionsonsave instead with a source“
sql server中关于FORCESCAN的使用以及注意项
信息安全数学基础 Chapter 2——同余
端口规划与APJ
Connection and difference of network streaming media protocol (RTP RTCP RTMP HLS)
用实际案例分析PMP与ACP应该考哪个?哪个更有用?
信息安全数学基础 Chapter 1——整除
Learning C language from scratch day 039
Chip mass production, oppo entering a new era?
6-3 批量求和(*)
ffmpeg硬编解码 Inter QSV
LeetCode-384. Scramble array
Leetcode-- array
CentOS7服务器配置(四)---安装redis
Authing biweekly news: online application market (5.10-5.22)
Chapter II relational database