1. Error reporting details
fail to open MySQL connection: [CDC:ErrMySQLConnectionError]Error 1298: Unknown or incorrect time zone: 'Asia/Shanghai'
2. Troubleshooting
# Login tidb and check the time zone
show variables like '%time_zone%';
+------------------+---------------+
| Variable_name | Value |
+------------------+---------------+
| system_time_zone | Asia/Shanghai |
| time_zone | SYSTEM |
+------------------+---------------+
# login mysql and check the time zone
show variables like '%time_zone%';
+------------------+--------+
| Variable_name | Value |
+------------------+--------+
| system_time_zone | CST |
| time_zone | SYSTEM |
+------------------+--------+
It can be found that the time zone of the upstream tidb is North America/USA, while the time zone of the downstream MySQL is CST
3. Solution
Method 1: load the time zone
mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root mysql -p
Method 2: write sink to upstream and downstream time zones
cdc cli changefeed create --sink-uri="mysql://user:password@mysql_ip:mysql_port/?time-zone=CST" --pd=http://pd_ip:pd_port
Read More:
- Solve ERROR 1231 (42000): Variable’time_zone’ can’t
- Mybatis Error: The server time zone value ‘����1532a0’ is unrecognized
- [Solved]ERROR 1067 (42000): Invalid default value for ‘end_time‘ Mysql
- ERROR 1075 (42000) Incorrect table definition; there can be only one auto column and it must be defi
- [Solved] ERROR 1054 (42S22): Unknown column ‘password‘ in ‘field list‘
- [Solved] MySQL5.6.44 [Err] 1067 – Invalid default value for create_date settlement programme
- ERROR 1054(42S22) Unknown column ‘password’ in ‘field list’ (Fixed)
- [Solved] MYSQL Error: unknown error 1130, unknown error 1045
- Mysql5.7.18.1 Error 1054 (42S22): Unknown Column’password’ In’field List’ When Changing User Password
- How to Fix MySQL error 1005: can’t create table (errno: 150)
- Lock request time out period exceeded. (Microsoft SQL Server, Error: 1222)
- [Solved]Error 1054 (42s22): unknown column ‘password’ in ‘field list’ how to modify the password
- [Solved] Daily further: database error: unknown column ‘model’ in ‘field list‘
- MYSQL Create TIMESTAMP and Save Error: ERROR 1067 (42000): Invalid default value for ‘last_updated_on’
- Oracle11g Startup Database Error: ORA-27154: post/wait create failed
- [Solved] Windows MYSQL Error: django.db.utils.OperationalError: (2026, ‘SSL connection error: unknown error number‘)
- [Solved] com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server.
- [Solved] pymysql.err.internalError: (1054, “Unknown column ‘LGD_xiaohong’ in ‘field list’”)
- [Solved] mysql [ERR] 1273 – Unknown collation: ‘utf8mb4_0900_ai_ci’
- [MySQL] Note that MySQL5.1 does not support utf8mb4 Error 1115: Unknown character set:’utf8mb4′