TiDB DM passwords cannot contain underscores

This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: tidb dm密码中不能带有下划线

| username: keyway

【TiDB Usage Environment】Production Environment / Testing / Poc
【TiDB Version】7.5.0
【Reproduction Path】

  1. Using DM to synchronize MySQL 8.0 data, an error occurred

  1. Later upgraded to version 7.6.0, the same error occurred

  2. Initially thought it was a compatibility issue between TiDB and MySQL 8.0.34, tried various methods.

  3. Later tried various methods and found that when the password contains an underscore, incremental synchronization fails, but full synchronization succeeds.
    Account: tidb Password: 89DIKCnbv_kdOCKlck678

DM script is as follows:
name: “youpin_merge”
task-mode: all # Perform full data migration + incremental data migration
meta-schema: “task_youpin_merge”
clean-dump-file: true # Whether to clean up files generated during the dump phase, including metadata files, database and table creation SQL files, and data import SQL files
ignore-checking-items: [“auto_increment_ID”,“table_schema”]

【Encountered Problem: Phenomenon and Impact】
Due to the inability to connect to GIT, I am raising a BUG for the official team or for everyone to be aware of when using it. Currently known that versions 7.5.0 and 7.6.0 have this issue.
【Resource Configuration】Enter TiDB Dashboard - Cluster Info - Hosts and take a screenshot of this page
【Attachments: Screenshots/Logs/Monitoring】

| username: 哈喽沃德 | Original post link

If it’s not allowed, just use a different character.

| username: 小龙虾爱大龙虾 | Original post link

If the password contains special characters, you can use this to bypass: 管理 TiDB Data Migration 上游数据源 | PingCAP 文档中心

| username: tidb菜鸟一只 | Original post link

Encrypt it…

| username: forever | Original post link

Kill multiple birds with one stone :+1:

| username: 有猫万事足 | Original post link

It’s not a good idea to leave passwords exposed in configuration files. I strongly recommend encrypting them. Whether it’s TiDB or MySQL, it’s better to store encrypted passwords in the configuration files.

| username: Jellybean | Original post link

It is recommended to use encrypted passwords. DM provides a method to encrypt database passwords:

In the DM-related configuration files, it is recommended to use passwords encrypted by dmctl. For the same original password, the encrypted password will be different each time.

./dmctl -encrypt 'abc!@#123'
| username: 双开门变频冰箱 | Original post link

It is recommended to encrypt files that have passwords.

| username: TiDBer_vfJBUcxl | Original post link

:+1: :+1: :+1:

| username: 有猫万事足 | Original post link

I specifically looked up the YAML file specification, and even in the latest specification from a few months ago, the underscore is mentioned in the section on escape characters.


Escaped Unicode non-breaking space (xA0) character.

[56] ns-esc-non-breaking-space ::= ‘_’

You can find a bunch of similar issues by searching for “yaml + underscore,” spanning from Java to Go.
So, the issue with parsing underscores in non-escaped contexts might not be a bug.
It could be that the specification requires it to be this way.

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.