# Using TiDB Binlog - Drainer Launches

```
./bin/drainer -config drainer.toml -initial-commit-st {initial-commit-ts}

# Drainer Configuration.

addr = "192.168.0.13:8249"
data-dir = "data.drainer"
pd-urls = "http://192.168.0.16:2379,http://192.168.0.15:2379,http://192.168.0.14:2379"
log-file = "drainer.log"
db-type = "mysql"
[syncer.to]
host = "192.168.0.13"
user = "root"
password = ""
port = 3306
```
-------------------------------------------------------------
We can start the Drainer node with the following command:
. /bin/drainer -config drainer.toml -initial-commit-ts {initial-commit-ts}
Note:
1. If the downstream is MySQL/TiDB, in order to ensure the integrity of the data, you need to get the value of initial-commit-ts before starting Drainer for the first time, and perform a in full volume backup and recover of the data.
2. The drainer.toml configuration file mainly specifies the address of the drainer, the data storage location, the time interval for querying Pump online, and the address of the downstream database, etc., for example:

# Drainer Configuration.

# Address Where Drainer Provides Services ("192.168.0. 13:8249 ")
addr = "192.168.0. 13:8249"

# The Address Where Drainer Provides External Services
advertise-addr = "192.168.0. 13:8249"

# Time Interval for Querying PD for Online Pumps (default 10, in Seconds)
detect-interval = 10

# Drainer Data Storage Location Path (default "data.drainer")
data-dir = "data.drainer"

# Addresses of PD Cluster Nodes (separated by Commas, No Spaces in Between)
pd-urls ="http://192.168.0.16:2379,http://192.168.0.15:2379,http://192.168.0.14:2379"

# Log File Path
log-file ="drainer.log"

# Drainer Downstream Service Type (default is Mysql)
# Valid Parameter Values are "mysql", "tidb", "file", "kafka"
db-type = "mysql"

# Downstream Database Server Parameters When Db-type is Set to MySQL
[syncer.to]
host = "192.168.0.13"
user = "root"
password = ""
# Passwords That Use ./binlogctl -cmd encrypt -text string Encryption
# Password is Ignored If Encrypted_password is Not Empty
encrypted_password = ""
port = 3306

For detailed configuration, please refer to: https://docs.pingcap.com/zh/tidb/dev/deploy-tidb-binlog