TiCDC Creating Sync Task Reports Connection to MySQL Timeout

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: ticdc 创建同步任务报连接mysql超时

| username: 消息终结者

【TiDB Usage Environment】POC
【TiDB Version】6.5.2
【Reproduction Path】
【Encountered Problem: Problem Phenomenon and Impact】
Scenario:
TiDB data synchronization to MySQL
Script:
/home/tidb/deploy/cdc-8300/bin/cdc cli changefeed create --server=http://10.138.xx.xx:8300 --sink-uri=“mysql://dba:123456@10.128.xx.xx:3316/?TZ=Asia/Shanghai” --config=“/data1/tidb/cdc-8300/conf/oneid_e_participation_record.cnf” --changefeed-id=“c-test-task”

Phenomenon
When creating a synchronization task, it reports a timeout error when connecting to MySQL
Error: [CDC:ErrMySQLConnectionError]fail to open MySQL connection: dial tcp 10.128.xx.xx:3316: i/o timeout

| username: Kongdom | Original post link

Is the firewall turned on? Are the username and password correct? Can you connect manually?

| username: Billmay表妹 | Original post link

When creating a synchronization task, a connection timeout error to MySQL occurs. This may be due to the following reasons:

  1. Network connection issues: Ensure that the network connection between TiDB and MySQL is normal. You can try using other tools (such as MySQL client) to connect to the MySQL server to verify if the connection is normal. Also, check the firewall settings to ensure that the TiDB server can access port 3316 of the MySQL server.
  2. MySQL server configuration issues: Ensure that the MySQL server configuration allows connections from the TiDB server. You can check the MySQL configuration file (usually my.cnf or my.ini) to see if there are any settings that restrict connections, such as max_connections.
  3. High load on the MySQL server: If the MySQL server load is too high, it may cause connection timeouts. You can check the load status of the MySQL server, such as CPU usage, memory usage, etc. If the load is too high, try optimizing the MySQL server configuration or increasing hardware resources.
  4. Firewall or security group settings: Ensure that the firewall or security group settings between the TiDB server and the MySQL server allow communication. You can check the firewall or security group rules to ensure that the TiDB server is allowed to access port 3316 of the MySQL server.
| username: 小龙虾爱大龙虾 | Original post link

The error indicates a network issue. Please ensure that all TiCDC nodes can connect to the downstream MySQL.

| username: 消息终结者 | Original post link

There is no problem with manual connection. Now just confirm if accessing MySQL from the ticdc server works.

| username: zhanggame1 | Original post link

Is the manual test conducted on the machine where CDC is running?

| username: Jellybean | Original post link

Use this account and password to manually connect to the downstream database with MySQL on each TiCDC node machine, verify the access situation, and it will be easier to solve the problem after reproducing it.

| username: andone | Original post link

Try connecting manually to see if there are any errors.

| username: 像风一样的男子 | Original post link

Try using telnet on the CDC server to check if you can connect to the MySQL server’s IP and port.

| username: 消息终结者 | Original post link

Solved
The MySQL password contains special characters, and it was successfully created after URI encoding.

| username: Kongdom | Original post link

:handshake: :handshake: :handshake:

| username: TiDBer_gxUpi9Ct | Original post link

Manually link it.

| username: Kongdom | Original post link

:point_up_2: Manually connected, check the best answer above :yum:

| username: dba远航 | Original post link

Caused by MYSQL connection

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.