TiCDC Fails to Create Sync Task Due to Inaccessible Database

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

Original topic: ticdc创建同步任务报无法访问数据库

| username: TiDBer_9l6JZ3ks

[TiDB Usage Environment] Production Environment
[TiDB Version] Source TiDB Cluster (v6.1.0) Target TiDB Cluster (v6.5.0)
[Reproduction Path] Use the tiup cdc cli changefeed create command to synchronize data from the v6.1.0 cluster to the v6.5.0 cluster
[Encountered Issue: Phenomenon and Impact]
When creating the changefeed task with the command:

tiup cdc cli changefeed create --pd=http://172.16.0.9:2379 --sink-uri="mysql://root:xxx@172.20.0.6:4000" --changefeed-id="simple-replication-task" --config changefeed.toml

It reports the error: Error: [CDC:ErrMySQLConnectionError] fail to open MySQL connection: Error 1045: Access denied for user 'root'@'172.16.0.9' (using password: YES).
172.16.0.9 is the source database and the current host address.
[Resource Configuration]
[Attachments: Screenshots/Logs/Monitoring]

| username: ealam_小羽 | Original post link

Check if there are any issues with user permissions, IP restrictions, or password format:

| username: dba-kit | Original post link

You need to write the username and password of the downstream cluster here. I guess you used the root password of the upstream.

| username: 裤衩儿飞上天 | Original post link

First, try to see if you can log in with the downstream database’s username and password.

| username: tidb菜鸟一只 | Original post link

Try logging in directly from the 172.16.0.9 machine using the command: mysql -h 172.20.0.6 -P4000 -uroot -p

| username: asddongmen | Original post link

  1. It is recommended to first check whether the username and password in the sink-uri are correctly specified as the downstream username and password.
  2. After step 1, if the connection still fails, consider escaping the password and trying again.