Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.Original topic: MySQL 5.7.40 至 TiDB 6.1 的 DM 迁移任务,报错 Error 3167: The ‘INFORMATION_SCHEMA.GLOBAL_STATUS’ feature is disabled
【Environment】Test Environment
【Environment Description】
-
Software Version
-
Upstream Data Source and Migration Task Configuration
- Upstream Data Source
[tidb@localhost ~]$ tiup dmctl --master-addr 192.168.3.228:8261 operate-source show
{
"result": true,
"msg": "",
"sources": [
{
"result": true,
"msg": "",
"source": "mysql_3_228",
"worker": "dm-192.168.3.228-8263"
}
]
}
- Migration Task Configuration
[tidb@localhost ~]$ more dm_test228.yaml
# 1. Global Configuration
name: dm_test228 # Specify the migration task name
task-mode: all # Specify the migration mode. "all" means "full migration + incremental synchronization"
meta-schema: "dm_meta" # Specify the database for storing meta information downstream, default is dm_meta
case-sensitive: false # Case insensitive for object names
# 2. Define the upstream MySQL data source and applied filter rules
mysql-instances:
- source-id: "mysql_3_228" # Specify the source-id of the upstream MySQL data source
block-allow-list: "ba-block-228" # Specify the bound database object block-allow-list rule
filter-rules: ["filter-rule-ignore"] # Specify the bound binlog event filter rule
route-rules: ["route-rule-228"] # Specify the bound route rule
# 3. Downstream TiDB Database Configuration
target-database:
host: "192.168.3.220" # Specify the IP of the downstream TiDB
port: 13390 # Specify the port of the downstream TiDB database
user: "dm_tidb" # Specify the user of the downstream TiDB database
password: "1x7n9z9VKEFIj360AhYMOEBE5bjtMnQS" # Specify the encrypted password of the downstream TiDB database using dmctl --encrypt
session: # Specify the session variables when connecting to TiDB
tidb_skip_utf8_check: 1
# 4. Define the specific content of the upstream MySQL database block-allow-list, filters, and routes rules
# 4.1 Define the specific content of the block-allow-list rule
block-allow-list:
ba-allow-228: # Database object filter rule name
do-dbs: ["tpcc"] # Databases to migrate, multiple names separated by commas
ignore-dbs: ["mysql", "account"] # Databases to ignore, multiple names separated by commas
ba-block-228: # Database object filter rule name
ignore-tables: # Tables to ignore
- db-name: "tpcc"
tbl-name: "history" # Ignore the upstream tpcc.history table
# 4.2 Define the specific content of the binlog event filter rule
filters:
filter-rule-ignore: # Binlog event filter rule name
schema-pattern: "tpcc" # Database name matching rule, supports wildcards "*" and "?"
table-pattern: "orders" # Table name matching rule, supports wildcards "*" and "?"
events: ["truncate table", "drop table"] # Event types to match
action: Ignore # Ignore the specified operations in events
# 4.3 Define the specific content of the routes rule, i.e., which upstream database/table syncs to which downstream database/table. Commonly used for database/table merging synchronization
routes:
route-rule-228: # Route rule name
schema-pattern: "tpcc" # Sync the upstream tpcc database to the downstream apcc database
target-schema: "apcc"
【Fault Phenomenon】
- Error Content
"errors": [
{
"ErrCode": 32001,
"ErrClass": "dump-unit",
"ErrScope": "internal",
"ErrLevel": "high",
"Message": "mydumper/dumpling runs with error, with output (may empty): ",
"RawCause": "sql: SELECT `VARIABLE_NAME`,`VARIABLE_VALUE` FROM `information_schema`.`GLOBAL_STATUS` LIMIT 1, args: []: Error 3167: The 'INFORMATION_SCHEMA.GLOBAL_STATUS' feature is disabled; see the documentation for 'show_compatibility_56'",
"Workaround": ""
}
...
]
- The upstream MySQL database has enabled show_compatibility_56
mysql> show global variables like 'show_com%';
+-----------------------+-------+
| Variable_name | Value |
+-----------------------+-------+
| show_compatibility_56 | ON |
+-----------------------+-------+
1 row in set (0.00 sec)
- Performing a logical backup on the upstream MySQL using the dm_mysql user with dumpling works normally.