Skip to content

Commit

Permalink
ticdc: add how to use base64 encoded mysql password (#12101)
Browse files Browse the repository at this point in the history
* add how to use base64 encoded mysql password

* Update ticdc/ticdc-sink-to-mysql.md

Co-authored-by: shichun-0415 <[email protected]>

* Update ticdc/ticdc-sink-to-mysql.md

Co-authored-by: TomShawn <[email protected]>

* Update ticdc/ticdc-sink-to-mysql.md

Co-authored-by: TomShawn <[email protected]>

* Update ticdc/ticdc-sink-to-mysql.md

Co-authored-by: TomShawn <[email protected]>

* Update ticdc/ticdc-sink-to-mysql.md

Co-authored-by: TomShawn <[email protected]>

* Update ticdc/ticdc-changefeed-config.md

Co-authored-by: Aolin <[email protected]>

* Apply suggestions from code review

Co-authored-by: Aolin <[email protected]>

Co-authored-by: shichun-0415 <[email protected]>
Co-authored-by: TomShawn <[email protected]>
Co-authored-by: Aolin <[email protected]>
  • Loading branch information
4 people authored Dec 6, 2022
1 parent 4da9880 commit 68a109a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 8 deletions.
14 changes: 9 additions & 5 deletions ticdc/ticdc-changefeed-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,23 +51,27 @@ case-sensitive = true
# 是否输出 old value,从 v4.0.5 开始支持,从 v5.0 开始默认为 true
enable-old-value = true
# 是否开启 Syncpoint 功能,从 v6.3.0 开始支持
# 是否开启 Syncpoint 功能,从 v6.3.0 开始支持,该功能默认关闭。
# 从 v6.4.0 开始,使用 Syncpoint 功能需要同步任务拥有下游集群的 SYSTEM_VARIABLES_ADMIN 或者 SUPER 权限
enable-sync-point = true
# enable-sync-point = false
# Syncpoint 功能对齐上下游 snapshot 的时间间隔
# 配置格式为 h m s,例如 "1h30m30s"
# 默认值为 10m,最小值为 30s
sync-point-interval = "5m"
# sync-point-interval = "5m"
# Syncpoint 功能在下游表中保存的数据的时长,超过这个时间的数据会被清理
# 配置格式为 h m s,例如 "24h30m30s"
# 默认值为 24h
sync-point-retention = "1h"
# sync-point-retention = "1h"
[mounter]
# mounter 解码 KV 数据的线程数,默认值为 16
# worker-num = 16
[filter]
# 忽略指定 start_ts 的事务
ignore-txn-start-ts = [1, 2]
# ignore-txn-start-ts = [1, 2]
# 过滤器规则
# 过滤规则语法:https://docs.pingcap.com/zh/tidb/stable/table-filter#表库过滤语法
Expand Down
19 changes: 16 additions & 3 deletions ticdc/ticdc-sink-to-mysql.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ URI 中可配置的参数如下:
| 参数 | 描述 |
| :------------ | :------------------------------------------------ |
| `root` | 下游数据库的用户名。 |
| `123456` | 下游数据库密码。 |
| `123456` | 下游数据库密码。(可采用 Base64 进行编码) |
| `127.0.0.1` | 下游数据库的 IP。 |
| `3306` | 下游数据的连接端口。 |
| `worker-count` | 向下游执行 SQL 的并发度(可选,默认值为 `16`)。 |
Expand All @@ -58,10 +58,23 @@ URI 中可配置的参数如下:
| `ssl-cert` | 连接下游 MySQL 实例所需的证书文件路径(可选)。 |
| `ssl-key` | 连接下游 MySQL 实例所需的证书密钥文件路径(可选)。 |
| `time-zone` | 连接下游 MySQL 实例时使用的时区名称,从 v4.0.8 开始生效。(可选。如果不指定该参数,使用 TiCDC 服务进程的时区;如果指定该参数但使用空值,则表示连接 MySQL 时不指定时区,使用下游默认时区)。 |
| `transaction-atomicity` | 指定事务的原子性级别(可选,默认值为 `table`)。当该值为 `table` 时 TiCDC 保证单表事务的原子性,当该值为 `none` 时 TiCDC 会拆分单表事务。 |
| `transaction-atomicity` | 指定事务的原子性级别(可选,默认值为 `none`)。当该值为 `table` 时 TiCDC 保证单表事务的原子性,当该值为 `none` 时 TiCDC 会拆分单表事务。 |

若需要对 Sink URI 中的数据库密码使用 Base64 进行编码,可以参考如下命令:

```shell
echo -n '123456' | base64 # 假设待编码的密码为 123456
```

编码后的密码如下:

```shell
MTIzNDU2
```

> **注意:**
> URI 中包含特殊字符时,如 `! * ' ( ) ; : @ & = + $ , / ? % # [ ]`,需要对 URI 特殊字符进行转义处理。你可以在 [URI Encoder](https://meyerweb.com/eric/tools/dencoder/) 中对 URI 进行转义。
>
> 当 Sink URI 中包含特殊字符时,如 `! * ' ( ) ; : @ & = + $ , / ? % # [ ]`,需要对 URI 特殊字符进行转义处理。你可以使用 [URI Encoder](https://meyerweb.com/eric/tools/dencoder/) 工具对 URI 进行转义。
## 灾难场景的最终一致性复制

Expand Down

0 comments on commit 68a109a

Please sign in to comment.