Error Using dmctl Command

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

Original topic: dmctl 命令使用报错

| username: TiDBer_CkS2lbTx

When using dmctl encrypt to encrypt the password, an error occurred. Did I use the wrong syntax?

[root@infra-benc-tidb-ansilbe tidb-community-toolkit-v8.0.0-linux-amd64]# tiup dmctl encrypt 'mysql'
Starting component dmctl: /root/.tiup/components/dmctl/v8.1.0/dmctl/dmctl encrypt mysql
Error: --master-addr not provided, this parameter is required when interacting with the dm-master, you can also use environment variable 'DM_MASTER_ADDR' to specify the value. Use `dmctl --help` to see more help messages

| username: zhaokede | Original post link

dmctl --master-addr=“127.0.0.1:8261” encrypt “your_password_here”

| username: TiDBer_CkS2lbTx | Original post link

It won’t work.

| username: zhaokede | Original post link

How about executing it in the deployment tool’s location? Have you added the environment variables?

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

Your DM version and cluster version are different, right? Try using the same version.

| username: TiDBer_CkS2lbTx | Original post link

The same.

| username: Kongdom | Original post link

Based on the previous posts, it should be missing parameters.

| username: TiDBer_CkS2lbTx | Original post link

Resolved

| username: Kongdom | Original post link

How did you solve it? Please share so that other students can quickly resolve similar issues.

| username: TiDBer_CkS2lbTx | Original post link

The dmctl installed by tiup defaults to the latest version, while the dm cluster version is manually specified (I specified v7.5.0). Currently, the latest dmctl version is 8.1.0. There are two solutions: either downgrade the dmctl version (download an older version of the tool package) or upgrade the dm cluster version. Additionally, add a 64-bit key file directory path (secret-key-path=xxx) in the dm-master configuration file.

| username: FutureDB | Original post link

May I ask, what is the purpose of this configuration step?

| username: Kongdom | Original post link

:handshake: :handshake: :handshake: Thank you for sharing

| username: TiDBer_CkS2lbTx | Original post link

The new version requires it; otherwise, an error will be reported.

| username: Jack-li | Original post link

Encountered a problem and just saw the answer, good!

| username: zhh_912 | Original post link

Replace password_to_encrypt with the password that needs to be encrypted. Add the --master-addr parameter.