# TiCDC 的使用 - 创建同步任务

__*TiCDC 使用*__
__*TiCDC 创建同步任务*__

```
cdc cli changefeed create 
--pd=http://10.0.10.25:2379 
--sink-uri="mysql://root:123456@127.0.0.1:3306/" 
--changefeed-id="simple-replication-task" 
--sort-engine=“unified"
```
-------------------------------------------------------------
在 TiCDC 中,一个同步任务被称为一个 changefeed ,我们可以通过下面的命令来创建一个 changefeed ,其中 create 为创建任务命令,--pd=http://10.0.10.25:2379 代表上游 TiDB 的一个 PD 地址,--sink-uri="mysql://root:123456@127.0.0.1:3306/" 表示下游数据库,在例子中是一台 MySQL 数据库（IP:127.0.0.1,Port:3306）,--changefeed-id="simple-replication-task" 表示这次任务的id。命令执行成功后,任务便启动完毕。

tiup cdc cli changefeed create --pd=http://10.0.10.25:2379 --sink-uri="mysql://root:123456@127.0.0.1:3306/" --changefeed-id=“simple-replication-task"

输出:
Create changefeed successfully!
ID: simple-replication-task
Info: {“sink-uri":"mysql://root:123456@127.0.0.1:3306/","opts":{},"create-time":"2020-03-12T22:04:08.103600025+08:00","start-ts":415241823337054209,"target-ts":0,"admin-job-type":0,"sort-engine":"unified","sort-dir":".","config":{"case-sensitive":true,"filter":{"rules":["*.*"],"ignore-txn-start-ts":null,"ddl-allow-list":null},"mounter":{"worker-num":16},"sink":{"dispatchers":null},"scheduler":{"type":"table-number","polling-time":-1}},"state":"normal","history":null,"error":null}