Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: ticdc 创建同步任务报连接mysql超时
【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
Is the firewall turned on? Are the username and password correct? Can you connect manually?
When creating a synchronization task, a connection timeout error to MySQL occurs. This may be due to the following reasons:
- 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.
- 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.
- 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.
- 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.
The error indicates a network issue. Please ensure that all TiCDC nodes can connect to the downstream MySQL.
There is no problem with manual connection. Now just confirm if accessing MySQL from the ticdc server works.
Is the manual test conducted on the machine where CDC is running?
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.
Try connecting manually to see if there are any errors.
Try using telnet on the CDC server to check if you can connect to the MySQL server’s IP and port.
Solved
The MySQL password contains special characters, and it was successfully created after URI encoding.
Manually connected, check the best answer above
Caused by MYSQL connection
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.