-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ticdc: clarify that you don't escape the whole URL but just the param…
…eters (#17052)
- Loading branch information
1 parent
0be8401
commit fe20338
Showing
2 changed files
with
13 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,15 +51,15 @@ Sink URI 用于指定 TiCDC 目标系统的连接信息,遵循以下格式: | |
一个通用的配置样例如下所示: | ||
|
||
```shell | ||
--sink-uri="mysql://root:123456@127.0.0.1:3306" | ||
--sink-uri="mysql://root:12345678@127.0.0.1:3306" | ||
``` | ||
|
||
URI 中可配置的参数如下: | ||
|
||
| 参数 | 描述 | | ||
| :------------ | :------------------------------------------------ | | ||
| `root` | 下游数据库的用户名。当同步数据到 TiDB 或其它兼容 MySQL 的数据库时,下游数据库的用户需要具备[一定的权限](#下游数据库用户所需的权限)。 | | ||
| `123456` | 下游数据库密码。(可采用 Base64 进行编码) | | ||
| `12345678` | 下游数据库密码。(可采用 Base64 进行编码) | | ||
| `127.0.0.1` | 下游数据库的 IP。 | | ||
| `3306` | 下游数据的连接端口。 | | ||
| `worker-count` | 向下游执行 SQL 的并发度(可选,默认值为 `16`)。 | | ||
|
@@ -74,18 +74,25 @@ URI 中可配置的参数如下: | |
若需要对 Sink URI 中的数据库密码使用 Base64 进行编码,可以参考如下命令: | ||
|
||
```shell | ||
echo -n '123456' | base64 # 假设待编码的密码为 123456 | ||
echo -n '12345678' | base64 # 假设待编码的密码为 12345678 | ||
``` | ||
|
||
编码后的密码如下: | ||
|
||
```shell | ||
MTIzNDU2 | ||
MTIzNDU2Nzg= | ||
``` | ||
|
||
> **注意:** | ||
> | ||
> 当 Sink URI 中包含特殊字符时,如 `! * ' ( ) ; : @ & = + $ , / ? % # [ ]`,需要对 URI 特殊字符进行转义处理。你可以使用 [URI Encoder](https://www.urlencoder.org/) 工具对 URI 进行转义。 | ||
> 当 Sink URI 的参数中包含特殊字符时,如 `! * ' ( ) ; : @ & = + $ , / ? % # [ ]`,需要对 URI 特殊字符进行转义处理。你可以使用 [URI Encoder](https://www.urlencoder.org/) 工具对 URI 进行转义。 | ||
> | ||
> 例如,如果连接到下游数据库的用户名为 `R&D (2)`、并要指定证书文件路径为 `/data1/R&D (2).pem` 时,需要对这些参数进行如下转义: | ||
> | ||
> ```shell | ||
> --sink-uri="mysql://R%26D%20%282%29:MTIzNDU2Nzg%[email protected]:3306/?ssl-cert=/data1/R%26D%20%282%29.pem" | ||
> # ^~~ ^~~^~~ ^~~ ^~~ ^~~ ^~~^~~ ^~~ | ||
> ``` | ||
## 下游数据库用户所需的权限 | ||
|