Copilot commented on code in PR #9326:
URL: https://github.com/apache/seatunnel/pull/9326#discussion_r2094790569
##########
docs/zh/connector-v2/source/Mysql-CDC.md:
##########
@@ -0,0 +1,356 @@
+import ChangeLog from '../changelog/connector-cdc-mysql.md';
+
+# MySQL CDC
+
+> MySQL CDC 源连接器
+
+## 支持的引擎
+
+> SeaTunnel Zeta<br/>
+> Flink <br/>
+
+## 描述
+
+MySQL CDC 连接器允许从 MySQL 数据库读取快照数据和增量数据,本文件描述了如何设置 MySQL CDC 连接器,以便对 MySQL
数据库执行SQL 查询。
+
+## 主要特性
+
+- [ ] [批处理](../../concept/connector-v2-features.md)
+- [x] [流处理](../../concept/connector-v2-features.md)
+- [x] [精确一次](../../concept/connector-v2-features.md)
+- [ ] [列投影](../../concept/connector-v2-features.md)
+- [x] [并行性](../../concept/connector-v2-features.md)
+- [x] [支持用户定义的拆分](../../concept/connector-v2-features.md)
+
+## 支持的数据源信息
+
+| 数据源 | 支持的版本
| 驱动 | Url |
Maven |
+|-------|------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------|----------------------------------|----------------------------------------------------------------------|
+| MySQL | <li> [MySQL](https://dev.mysql.com/doc): 5.5, 5.6, 5.7, 8.0.x
</li><li> [RDS MySQL](https://www.aliyun.com/product/rds/mysql): 5.6, 5.7,
8.0.x </li> | com.mysql.cj.jdbc.Driver | jdbc:mysql://localhost:3306/test |
https://mvnrepository.com/artifact/mysql/mysql-connector-java/8.0.28 |
+
+## 使用依赖
+
+### 安装 Jdbc 驱动
+
+#### 对于 Flink 引擎
+
+> 1. 你需要确保 [jdbc 驱动
jar包](https://mvnrepository.com/artifact/mysql/mysql-connector-java) 已经被放置在目录
`${SEATUNNEL_HOME}/plugins/`中。
+
+#### 对于 SeaTunnel Zeta 引擎
+
+> 1. 你需要确保 [jdbc 驱动
jar包](https://mvnrepository.com/artifact/mysql/mysql-connector-java) 已经被放置在目录
`${SEATUNNEL_HOME}/lib/`中。
+
+### 创建 MySQL 用户
+
+你必须为 Debezium MySQL 连接器 所监控的 所有数据库 创建一个具有适当权限的 MySQL 用户。
+
+1. 创建用户:
+
+```sql
+mysql> CREATE USER 'user'@'localhost' IDENTIFIED BY 'password';
+```
+
+2. 为用户授权必须的权限:
+
+```sql
+mysql> GRANT SELECT, RELOAD, SHOW DATABASES, REPLICATION SLAVE, REPLICATION
CLIENT ON *.* TO 'user' IDENTIFIED BY 'password';
+```
+
+3. 刷新权限使生效:
+
+```sql
+mysql> FLUSH PRIVILEGES;
+```
+
+### 启用 MySQL 二进制日志(Binlog)
+
+你必须确保为 MySQL 复制启用二进制日志记录。二进制日志会记录事务更新,以供复制工具传播变更。
+
+1. 检查 `log-bin` 选项是否开启:
+
+```sql
+mysql> show variables where variable_name in ('log_bin', 'binlog_format',
'binlog_row_image', 'gtid_mode', 'enforce_gtid_consistency');
++--------------------------+----------------+
+| 字段名 | 字段值 |
++--------------------------+----------------+
+| binlog_format | ROW |
+| binlog_row_image | FULL |
+| enforce_gtid_consistency | ON |
+| gtid_mode | ON |
+| log_bin | ON |
++--------------------------+----------------+
+```
+
+2. 如果 `log_bin` 选项未开启, 请使用下表中描述的属性配置您的 MySQL 服务器配置文件(`$MYSQL_HOME/mysql.cnf`):
+
+```
+# Enable binary replication log and set the prefix, expiration, and log format.
+# The prefix is arbitrary, expiration can be short for integration tests but
would
+# be longer on a production system. Row-level info is required for ingest to
work.
+# Server ID is required, but this will vary on production systems
+server-id = 223344
+log_bin = mysql-bin
+expire_logs_days = 10
+binlog_format = row
+# mysql 5.6+ requires binlog_row_image to be set to FULL
+binlog_row_image = FULL
+
+# optional enable gtid mode
+# mysql 5.6+ requires gtid_mode to be set to ON, but not required by mysql 8.0+
+gtid_mode = on
+enforce_gtid_consistency = on
+```
+
+重启MySQL 服务
+
+```shell
+/etc/inint.d/mysqld restart
Review Comment:
Typo in the path: `inint.d` should be `init.d` for the MySQL service restart
command.
```suggestion
/etc/init.d/mysqld restart
```
##########
docs/zh/connector-v2/source/Mysql-CDC.md:
##########
@@ -0,0 +1,356 @@
+import ChangeLog from '../changelog/connector-cdc-mysql.md';
+
+# MySQL CDC
+
+> MySQL CDC 源连接器
+
+## 支持的引擎
+
+> SeaTunnel Zeta<br/>
+> Flink <br/>
+
+## 描述
+
+MySQL CDC 连接器允许从 MySQL 数据库读取快照数据和增量数据,本文件描述了如何设置 MySQL CDC 连接器,以便对 MySQL
数据库执行SQL 查询。
+
+## 主要特性
+
+- [ ] [批处理](../../concept/connector-v2-features.md)
+- [x] [流处理](../../concept/connector-v2-features.md)
+- [x] [精确一次](../../concept/connector-v2-features.md)
+- [ ] [列投影](../../concept/connector-v2-features.md)
+- [x] [并行性](../../concept/connector-v2-features.md)
+- [x] [支持用户定义的拆分](../../concept/connector-v2-features.md)
+
+## 支持的数据源信息
+
+| 数据源 | 支持的版本
| 驱动 | Url |
Maven |
+|-------|------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------|----------------------------------|----------------------------------------------------------------------|
+| MySQL | <li> [MySQL](https://dev.mysql.com/doc): 5.5, 5.6, 5.7, 8.0.x
</li><li> [RDS MySQL](https://www.aliyun.com/product/rds/mysql): 5.6, 5.7,
8.0.x </li> | com.mysql.cj.jdbc.Driver | jdbc:mysql://localhost:3306/test |
https://mvnrepository.com/artifact/mysql/mysql-connector-java/8.0.28 |
+
+## 使用依赖
+
+### 安装 Jdbc 驱动
+
+#### 对于 Flink 引擎
+
+> 1. 你需要确保 [jdbc 驱动
jar包](https://mvnrepository.com/artifact/mysql/mysql-connector-java) 已经被放置在目录
`${SEATUNNEL_HOME}/plugins/`中。
+
+#### 对于 SeaTunnel Zeta 引擎
+
+> 1. 你需要确保 [jdbc 驱动
jar包](https://mvnrepository.com/artifact/mysql/mysql-connector-java) 已经被放置在目录
`${SEATUNNEL_HOME}/lib/`中。
+
+### 创建 MySQL 用户
+
+你必须为 Debezium MySQL 连接器 所监控的 所有数据库 创建一个具有适当权限的 MySQL 用户。
+
+1. 创建用户:
+
+```sql
+mysql> CREATE USER 'user'@'localhost' IDENTIFIED BY 'password';
+```
+
+2. 为用户授权必须的权限:
+
+```sql
+mysql> GRANT SELECT, RELOAD, SHOW DATABASES, REPLICATION SLAVE, REPLICATION
CLIENT ON *.* TO 'user' IDENTIFIED BY 'password';
+```
+
+3. 刷新权限使生效:
+
+```sql
+mysql> FLUSH PRIVILEGES;
+```
+
+### 启用 MySQL 二进制日志(Binlog)
+
+你必须确保为 MySQL 复制启用二进制日志记录。二进制日志会记录事务更新,以供复制工具传播变更。
+
+1. 检查 `log-bin` 选项是否开启:
+
+```sql
+mysql> show variables where variable_name in ('log_bin', 'binlog_format',
'binlog_row_image', 'gtid_mode', 'enforce_gtid_consistency');
++--------------------------+----------------+
+| 字段名 | 字段值 |
++--------------------------+----------------+
+| binlog_format | ROW |
+| binlog_row_image | FULL |
+| enforce_gtid_consistency | ON |
+| gtid_mode | ON |
+| log_bin | ON |
++--------------------------+----------------+
+```
+
+2. 如果 `log_bin` 选项未开启, 请使用下表中描述的属性配置您的 MySQL 服务器配置文件(`$MYSQL_HOME/mysql.cnf`):
+
+```
+# Enable binary replication log and set the prefix, expiration, and log format.
+# The prefix is arbitrary, expiration can be short for integration tests but
would
+# be longer on a production system. Row-level info is required for ingest to
work.
+# Server ID is required, but this will vary on production systems
+server-id = 223344
+log_bin = mysql-bin
+expire_logs_days = 10
+binlog_format = row
+# mysql 5.6+ requires binlog_row_image to be set to FULL
+binlog_row_image = FULL
+
+# optional enable gtid mode
+# mysql 5.6+ requires gtid_mode to be set to ON, but not required by mysql 8.0+
+gtid_mode = on
+enforce_gtid_consistency = on
+```
+
+重启MySQL 服务
+
+```shell
+/etc/inint.d/mysqld restart
+```
+
+4. 通过再次检查二进制日志状态来确认您的更改生效:
+
+MySQL 5.5:
+
+```sql
+mysql> show variables where variable_name in ('log_bin', 'binlog_format',
'binlog_row_image', 'gtid_mode', 'enforce_gtid_consistency');
++--------------------------+----------------+
+| 字段名 | 字段值 |
++--------------------------+----------------+
+| binlog_format | ROW |
+| log_bin | ON |
++--------------------------+----------------+
+```
+
+MySQL 5.6+:
+
+```sql
+mysql> show variables where variable_name in ('log_bin', 'binlog_format',
'binlog_row_image', 'gtid_mode', 'enforce_gtid_consistency');
++--------------------------+----------------+
+| 字段名 | 字段值 |
++--------------------------+----------------+
+| binlog_format | ROW |
+| binlog_row_image | FULL |
+| enforce_gtid_consistency | ON |
+| gtid_mode | ON |
+| log_bin | ON |
++--------------------------+----------------+
+```
+MySQL 8.0+:
+```sql
+show variables where variable_name in ('log_bin', 'binlog_format',
'binlog_row_image', 'gtid_mode', 'enforce_gtid_consistency')
++--------------------------+----------------+
+| 字段名 | 字段值 |
++--------------------------+----------------+
+| binlog_format | ROW |
+| binlog_row_image | FULL |
+| enforce_gtid_consistency | OFF |
+| gtid_mode | OFF |
+| log_bin | ON |
++--------------------------+----------------+
+
+```
+
+
+### 注意
+
+#### 设置 MySQL 会话超时时间
+
+当为大型数据库创建初始一致快照时,已建立的连接可能会在读取表的过程中超时。您可以通过在 MySQL 配置文件中配置 interactive_timeout
和 wait_timeout 来防止这种情况。
+- `interactive_timeout`: 服务器在关闭一个 交互式连接 之前等待其活动的时长。 更多细节可查看文档: [MySQL’s
documentation](https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_interactive_timeout)
+- `wait_timeout`: 服务器在关闭 非交互式连接 之前等待其活动的时长。 更多细节可查看文档: [MySQL’s
documentation](https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_wait_timeout)
+
+*获取更多数据库的配置信息: [Debezium MySQL
Connector](https://github.com/debezium/debezium/blob/v1.9.8.Final/documentation/modules/ROOT/pages/connectors/mysql.adoc#setting-up-mysql)*
+
+## 数据类型映射
+
+| Mysql 数据类型
| SeaTunnel 数据类型 |
+|------------------------------------------------------------------------------------------------|----------------|
+| BIT(1)<br/>TINYINT(1)
| BOOLEAN |
+| TINYINT
| TINYINT |
+| TINYINT UNSIGNED<br/>SMALLINT
| SMALLINT |
+| SMALLINT UNSIGNED<br/>MEDIUMINT<br/>MEDIUMINT
UNSIGNED<br/>INT<br/>INTEGER<br/>YEAR | INT |
+| INT UNSIGNED<br/>INTEGER UNSIGNED<br/>BIGINT
| BIGINT |
+| BIGINT UNSIGNED
| DECIMAL(20,0) |
+| DECIMAL(p, s) <br/>DECIMAL(p, s) UNSIGNED <br/>NUMERIC(p, s) <br/>NUMERIC(p,
s) UNSIGNED | DECIMAL(p,s) |
+| FLOAT<br/>FLOAT UNSIGNED
| FLOAT |
+| DOUBLE<br/>DOUBLE UNSIGNED<br/>REAL<br/>REAL UNSIGNED
| DOUBLE |
+|
CHAR<br/>VARCHAR<br/>TINYTEXT<br/>MEDIUMTEXT<br/>TEXT<br/>LONGTEXT<br/>ENUM<br/>JSON<br/>ENUM
| STRING |
+| DATE
| DATE |
+| TIME(s)
| TIME(s) |
+| DATETIME<br/>TIMESTAMP(s)
| TIMESTAMP(s) |
+|
BINARY<br/>VARBINAR<br/>BIT(p)<br/>TINYBLOB<br/>MEDIUMBLOB<br/>BLOB<br/>LONGBLOB
<br/>GEOMETRY | BYTES |
Review Comment:
Typo in `VARBINAR`; it should be `VARBINARY`.
```suggestion
|
BINARY<br/>VARBINARY<br/>BIT(p)<br/>TINYBLOB<br/>MEDIUMBLOB<br/>BLOB<br/>LONGBLOB
<br/>GEOMETRY | BYTES |
```
##########
docs/zh/connector-v2/source/Mysql-CDC.md:
##########
@@ -0,0 +1,356 @@
+import ChangeLog from '../changelog/connector-cdc-mysql.md';
+
+# MySQL CDC
+
+> MySQL CDC 源连接器
+
+## 支持的引擎
+
+> SeaTunnel Zeta<br/>
+> Flink <br/>
+
+## 描述
+
+MySQL CDC 连接器允许从 MySQL 数据库读取快照数据和增量数据,本文件描述了如何设置 MySQL CDC 连接器,以便对 MySQL
数据库执行SQL 查询。
+
+## 主要特性
+
+- [ ] [批处理](../../concept/connector-v2-features.md)
+- [x] [流处理](../../concept/connector-v2-features.md)
+- [x] [精确一次](../../concept/connector-v2-features.md)
+- [ ] [列投影](../../concept/connector-v2-features.md)
+- [x] [并行性](../../concept/connector-v2-features.md)
+- [x] [支持用户定义的拆分](../../concept/connector-v2-features.md)
+
+## 支持的数据源信息
+
+| 数据源 | 支持的版本
| 驱动 | Url |
Maven |
+|-------|------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------|----------------------------------|----------------------------------------------------------------------|
+| MySQL | <li> [MySQL](https://dev.mysql.com/doc): 5.5, 5.6, 5.7, 8.0.x
</li><li> [RDS MySQL](https://www.aliyun.com/product/rds/mysql): 5.6, 5.7,
8.0.x </li> | com.mysql.cj.jdbc.Driver | jdbc:mysql://localhost:3306/test |
https://mvnrepository.com/artifact/mysql/mysql-connector-java/8.0.28 |
+
+## 使用依赖
+
+### 安装 Jdbc 驱动
+
+#### 对于 Flink 引擎
+
+> 1. 你需要确保 [jdbc 驱动
jar包](https://mvnrepository.com/artifact/mysql/mysql-connector-java) 已经被放置在目录
`${SEATUNNEL_HOME}/plugins/`中。
+
+#### 对于 SeaTunnel Zeta 引擎
+
+> 1. 你需要确保 [jdbc 驱动
jar包](https://mvnrepository.com/artifact/mysql/mysql-connector-java) 已经被放置在目录
`${SEATUNNEL_HOME}/lib/`中。
+
+### 创建 MySQL 用户
+
+你必须为 Debezium MySQL 连接器 所监控的 所有数据库 创建一个具有适当权限的 MySQL 用户。
+
+1. 创建用户:
+
+```sql
+mysql> CREATE USER 'user'@'localhost' IDENTIFIED BY 'password';
+```
+
+2. 为用户授权必须的权限:
+
+```sql
+mysql> GRANT SELECT, RELOAD, SHOW DATABASES, REPLICATION SLAVE, REPLICATION
CLIENT ON *.* TO 'user' IDENTIFIED BY 'password';
+```
+
+3. 刷新权限使生效:
+
+```sql
+mysql> FLUSH PRIVILEGES;
+```
+
+### 启用 MySQL 二进制日志(Binlog)
+
+你必须确保为 MySQL 复制启用二进制日志记录。二进制日志会记录事务更新,以供复制工具传播变更。
+
+1. 检查 `log-bin` 选项是否开启:
+
+```sql
+mysql> show variables where variable_name in ('log_bin', 'binlog_format',
'binlog_row_image', 'gtid_mode', 'enforce_gtid_consistency');
++--------------------------+----------------+
+| 字段名 | 字段值 |
++--------------------------+----------------+
+| binlog_format | ROW |
+| binlog_row_image | FULL |
+| enforce_gtid_consistency | ON |
+| gtid_mode | ON |
+| log_bin | ON |
++--------------------------+----------------+
+```
+
+2. 如果 `log_bin` 选项未开启, 请使用下表中描述的属性配置您的 MySQL 服务器配置文件(`$MYSQL_HOME/mysql.cnf`):
+
+```
+# Enable binary replication log and set the prefix, expiration, and log format.
+# The prefix is arbitrary, expiration can be short for integration tests but
would
+# be longer on a production system. Row-level info is required for ingest to
work.
+# Server ID is required, but this will vary on production systems
+server-id = 223344
+log_bin = mysql-bin
+expire_logs_days = 10
+binlog_format = row
+# mysql 5.6+ requires binlog_row_image to be set to FULL
+binlog_row_image = FULL
+
+# optional enable gtid mode
+# mysql 5.6+ requires gtid_mode to be set to ON, but not required by mysql 8.0+
+gtid_mode = on
+enforce_gtid_consistency = on
+```
+
+重启MySQL 服务
+
+```shell
+/etc/inint.d/mysqld restart
+```
+
+4. 通过再次检查二进制日志状态来确认您的更改生效:
+
+MySQL 5.5:
+
+```sql
+mysql> show variables where variable_name in ('log_bin', 'binlog_format',
'binlog_row_image', 'gtid_mode', 'enforce_gtid_consistency');
++--------------------------+----------------+
+| 字段名 | 字段值 |
++--------------------------+----------------+
+| binlog_format | ROW |
+| log_bin | ON |
++--------------------------+----------------+
+```
+
+MySQL 5.6+:
+
+```sql
+mysql> show variables where variable_name in ('log_bin', 'binlog_format',
'binlog_row_image', 'gtid_mode', 'enforce_gtid_consistency');
++--------------------------+----------------+
+| 字段名 | 字段值 |
++--------------------------+----------------+
+| binlog_format | ROW |
+| binlog_row_image | FULL |
+| enforce_gtid_consistency | ON |
+| gtid_mode | ON |
+| log_bin | ON |
++--------------------------+----------------+
+```
+MySQL 8.0+:
+```sql
+show variables where variable_name in ('log_bin', 'binlog_format',
'binlog_row_image', 'gtid_mode', 'enforce_gtid_consistency')
++--------------------------+----------------+
+| 字段名 | 字段值 |
++--------------------------+----------------+
+| binlog_format | ROW |
+| binlog_row_image | FULL |
+| enforce_gtid_consistency | OFF |
+| gtid_mode | OFF |
+| log_bin | ON |
++--------------------------+----------------+
+
+```
+
+
+### 注意
+
+#### 设置 MySQL 会话超时时间
+
+当为大型数据库创建初始一致快照时,已建立的连接可能会在读取表的过程中超时。您可以通过在 MySQL 配置文件中配置 interactive_timeout
和 wait_timeout 来防止这种情况。
+- `interactive_timeout`: 服务器在关闭一个 交互式连接 之前等待其活动的时长。 更多细节可查看文档: [MySQL’s
documentation](https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_interactive_timeout)
+- `wait_timeout`: 服务器在关闭 非交互式连接 之前等待其活动的时长。 更多细节可查看文档: [MySQL’s
documentation](https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_wait_timeout)
+
+*获取更多数据库的配置信息: [Debezium MySQL
Connector](https://github.com/debezium/debezium/blob/v1.9.8.Final/documentation/modules/ROOT/pages/connectors/mysql.adoc#setting-up-mysql)*
+
+## 数据类型映射
+
+| Mysql 数据类型
| SeaTunnel 数据类型 |
+|------------------------------------------------------------------------------------------------|----------------|
+| BIT(1)<br/>TINYINT(1)
| BOOLEAN |
+| TINYINT
| TINYINT |
+| TINYINT UNSIGNED<br/>SMALLINT
| SMALLINT |
+| SMALLINT UNSIGNED<br/>MEDIUMINT<br/>MEDIUMINT
UNSIGNED<br/>INT<br/>INTEGER<br/>YEAR | INT |
+| INT UNSIGNED<br/>INTEGER UNSIGNED<br/>BIGINT
| BIGINT |
+| BIGINT UNSIGNED
| DECIMAL(20,0) |
+| DECIMAL(p, s) <br/>DECIMAL(p, s) UNSIGNED <br/>NUMERIC(p, s) <br/>NUMERIC(p,
s) UNSIGNED | DECIMAL(p,s) |
+| FLOAT<br/>FLOAT UNSIGNED
| FLOAT |
+| DOUBLE<br/>DOUBLE UNSIGNED<br/>REAL<br/>REAL UNSIGNED
| DOUBLE |
+|
CHAR<br/>VARCHAR<br/>TINYTEXT<br/>MEDIUMTEXT<br/>TEXT<br/>LONGTEXT<br/>ENUM<br/>JSON<br/>ENUM
| STRING |
+| DATE
| DATE |
+| TIME(s)
| TIME(s) |
+| DATETIME<br/>TIMESTAMP(s)
| TIMESTAMP(s) |
+|
BINARY<br/>VARBINAR<br/>BIT(p)<br/>TINYBLOB<br/>MEDIUMBLOB<br/>BLOB<br/>LONGBLOB
<br/>GEOMETRY | BYTES |
+
+## 源选项
+
+| 名称 | 类型 | 必需 | 默认 |
描述
|
+|------------------------------------------------|----------|----|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| base-url | String | 是 | - |
JDBC 连接的 URL,参考案例 `jdbc:mysql://localhost:3306/test`。
|
+| username | String | 是 | - |
连接到数据库服务器时使用的用户名称。
|
+| password | String | 是 | - |
连接到数据库服务器时使用的用户密码。
|
+| database-names | List | 否 | - |
需要监听的数据库名。
|Database
name of the database to monitor.
|
Review Comment:
The table row for `database-names` is broken by an extra pipe and trailing
English text. Merge the English description into the same cell or remove the
extra pipe to restore proper table formatting.
```suggestion
| database-names | List | 否 | - |
需要监听的数据库名。 Database name of the database to monitor.
|
```
##########
docs/zh/connector-v2/source/Mysql-CDC.md:
##########
@@ -0,0 +1,356 @@
+import ChangeLog from '../changelog/connector-cdc-mysql.md';
+
+# MySQL CDC
+
+> MySQL CDC 源连接器
+
+## 支持的引擎
+
+> SeaTunnel Zeta<br/>
+> Flink <br/>
+
+## 描述
+
+MySQL CDC 连接器允许从 MySQL 数据库读取快照数据和增量数据,本文件描述了如何设置 MySQL CDC 连接器,以便对 MySQL
数据库执行SQL 查询。
+
+## 主要特性
+
+- [ ] [批处理](../../concept/connector-v2-features.md)
+- [x] [流处理](../../concept/connector-v2-features.md)
+- [x] [精确一次](../../concept/connector-v2-features.md)
+- [ ] [列投影](../../concept/connector-v2-features.md)
+- [x] [并行性](../../concept/connector-v2-features.md)
+- [x] [支持用户定义的拆分](../../concept/connector-v2-features.md)
+
+## 支持的数据源信息
+
+| 数据源 | 支持的版本
| 驱动 | Url |
Maven |
+|-------|------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------|----------------------------------|----------------------------------------------------------------------|
+| MySQL | <li> [MySQL](https://dev.mysql.com/doc): 5.5, 5.6, 5.7, 8.0.x
</li><li> [RDS MySQL](https://www.aliyun.com/product/rds/mysql): 5.6, 5.7,
8.0.x </li> | com.mysql.cj.jdbc.Driver | jdbc:mysql://localhost:3306/test |
https://mvnrepository.com/artifact/mysql/mysql-connector-java/8.0.28 |
+
+## 使用依赖
+
+### 安装 Jdbc 驱动
+
+#### 对于 Flink 引擎
+
+> 1. 你需要确保 [jdbc 驱动
jar包](https://mvnrepository.com/artifact/mysql/mysql-connector-java) 已经被放置在目录
`${SEATUNNEL_HOME}/plugins/`中。
+
+#### 对于 SeaTunnel Zeta 引擎
+
+> 1. 你需要确保 [jdbc 驱动
jar包](https://mvnrepository.com/artifact/mysql/mysql-connector-java) 已经被放置在目录
`${SEATUNNEL_HOME}/lib/`中。
+
+### 创建 MySQL 用户
+
+你必须为 Debezium MySQL 连接器 所监控的 所有数据库 创建一个具有适当权限的 MySQL 用户。
+
+1. 创建用户:
+
+```sql
+mysql> CREATE USER 'user'@'localhost' IDENTIFIED BY 'password';
+```
+
+2. 为用户授权必须的权限:
+
+```sql
+mysql> GRANT SELECT, RELOAD, SHOW DATABASES, REPLICATION SLAVE, REPLICATION
CLIENT ON *.* TO 'user' IDENTIFIED BY 'password';
+```
+
+3. 刷新权限使生效:
+
+```sql
+mysql> FLUSH PRIVILEGES;
+```
+
+### 启用 MySQL 二进制日志(Binlog)
+
+你必须确保为 MySQL 复制启用二进制日志记录。二进制日志会记录事务更新,以供复制工具传播变更。
+
+1. 检查 `log-bin` 选项是否开启:
+
+```sql
+mysql> show variables where variable_name in ('log_bin', 'binlog_format',
'binlog_row_image', 'gtid_mode', 'enforce_gtid_consistency');
++--------------------------+----------------+
+| 字段名 | 字段值 |
++--------------------------+----------------+
+| binlog_format | ROW |
+| binlog_row_image | FULL |
+| enforce_gtid_consistency | ON |
+| gtid_mode | ON |
+| log_bin | ON |
++--------------------------+----------------+
+```
+
+2. 如果 `log_bin` 选项未开启, 请使用下表中描述的属性配置您的 MySQL 服务器配置文件(`$MYSQL_HOME/mysql.cnf`):
+
+```
+# Enable binary replication log and set the prefix, expiration, and log format.
+# The prefix is arbitrary, expiration can be short for integration tests but
would
+# be longer on a production system. Row-level info is required for ingest to
work.
+# Server ID is required, but this will vary on production systems
+server-id = 223344
+log_bin = mysql-bin
+expire_logs_days = 10
+binlog_format = row
+# mysql 5.6+ requires binlog_row_image to be set to FULL
+binlog_row_image = FULL
+
+# optional enable gtid mode
+# mysql 5.6+ requires gtid_mode to be set to ON, but not required by mysql 8.0+
+gtid_mode = on
+enforce_gtid_consistency = on
+```
+
+重启MySQL 服务
+
+```shell
+/etc/inint.d/mysqld restart
+```
+
+4. 通过再次检查二进制日志状态来确认您的更改生效:
+
+MySQL 5.5:
+
+```sql
+mysql> show variables where variable_name in ('log_bin', 'binlog_format',
'binlog_row_image', 'gtid_mode', 'enforce_gtid_consistency');
++--------------------------+----------------+
+| 字段名 | 字段值 |
++--------------------------+----------------+
+| binlog_format | ROW |
+| log_bin | ON |
++--------------------------+----------------+
+```
+
+MySQL 5.6+:
+
+```sql
+mysql> show variables where variable_name in ('log_bin', 'binlog_format',
'binlog_row_image', 'gtid_mode', 'enforce_gtid_consistency');
++--------------------------+----------------+
+| 字段名 | 字段值 |
++--------------------------+----------------+
+| binlog_format | ROW |
+| binlog_row_image | FULL |
+| enforce_gtid_consistency | ON |
+| gtid_mode | ON |
+| log_bin | ON |
++--------------------------+----------------+
+```
+MySQL 8.0+:
+```sql
+show variables where variable_name in ('log_bin', 'binlog_format',
'binlog_row_image', 'gtid_mode', 'enforce_gtid_consistency')
++--------------------------+----------------+
+| 字段名 | 字段值 |
++--------------------------+----------------+
+| binlog_format | ROW |
+| binlog_row_image | FULL |
+| enforce_gtid_consistency | OFF |
+| gtid_mode | OFF |
+| log_bin | ON |
++--------------------------+----------------+
+
+```
+
+
+### 注意
+
+#### 设置 MySQL 会话超时时间
+
+当为大型数据库创建初始一致快照时,已建立的连接可能会在读取表的过程中超时。您可以通过在 MySQL 配置文件中配置 interactive_timeout
和 wait_timeout 来防止这种情况。
+- `interactive_timeout`: 服务器在关闭一个 交互式连接 之前等待其活动的时长。 更多细节可查看文档: [MySQL’s
documentation](https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_interactive_timeout)
+- `wait_timeout`: 服务器在关闭 非交互式连接 之前等待其活动的时长。 更多细节可查看文档: [MySQL’s
documentation](https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_wait_timeout)
+
+*获取更多数据库的配置信息: [Debezium MySQL
Connector](https://github.com/debezium/debezium/blob/v1.9.8.Final/documentation/modules/ROOT/pages/connectors/mysql.adoc#setting-up-mysql)*
+
+## 数据类型映射
+
+| Mysql 数据类型
| SeaTunnel 数据类型 |
+|------------------------------------------------------------------------------------------------|----------------|
+| BIT(1)<br/>TINYINT(1)
| BOOLEAN |
+| TINYINT
| TINYINT |
+| TINYINT UNSIGNED<br/>SMALLINT
| SMALLINT |
+| SMALLINT UNSIGNED<br/>MEDIUMINT<br/>MEDIUMINT
UNSIGNED<br/>INT<br/>INTEGER<br/>YEAR | INT |
+| INT UNSIGNED<br/>INTEGER UNSIGNED<br/>BIGINT
| BIGINT |
+| BIGINT UNSIGNED
| DECIMAL(20,0) |
+| DECIMAL(p, s) <br/>DECIMAL(p, s) UNSIGNED <br/>NUMERIC(p, s) <br/>NUMERIC(p,
s) UNSIGNED | DECIMAL(p,s) |
+| FLOAT<br/>FLOAT UNSIGNED
| FLOAT |
+| DOUBLE<br/>DOUBLE UNSIGNED<br/>REAL<br/>REAL UNSIGNED
| DOUBLE |
+|
CHAR<br/>VARCHAR<br/>TINYTEXT<br/>MEDIUMTEXT<br/>TEXT<br/>LONGTEXT<br/>ENUM<br/>JSON<br/>ENUM
| STRING |
Review Comment:
The `ENUM` type is listed twice in this mapping row. Remove the duplicate to
keep the table concise.
```suggestion
|
CHAR<br/>VARCHAR<br/>TINYTEXT<br/>MEDIUMTEXT<br/>TEXT<br/>LONGTEXT<br/>ENUM<br/>JSON
| STRING |
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]