0

I created a TiDB cluster with Docker, not Docker Compose. When I tested the TiDB account, I changed the root password, and then I had no way to connect to my cluster database.

We all know that there is mysqld-safe mode in MySQL to skip the grant table for passwordless login. Then in the TiDB cluster, what method should be used for the same or similar operations?

Of course, the way I found in the TiDB FAQ is to close the TiDB server and run it with the parameter ‘-skip-grant-table=true’. But unfortunately, this way in the cluster of docker deployment, I can only delete the TiDB container and then run a new container. This way I rerun the TiDB and can't even run.

I don't know how to do it, I look forward to your answer!!

General Grievance
  • 4,555
  • 31
  • 31
  • 45
Narcism
  • 1
  • 1

1 Answers1

0
  1. Modify the tidb-server configuration file, add the following parameters, and then restart tidb-server:

[security] skip-grant-table = true

  1. Please refer to the documentation for modifying the user password:

https://pingcap.com/docs-cn/sql/user-account-management/

After the modification, you need to flush the privileges:

flush privileges

Chun Chen
  • 11
  • 1
Bo Liu
  • 16
  • 2
  • I would like to follow your answer, but there are another question. I have three Tikv configuration files named last_tikv.toml in folder tikv1,tikv2,tikv3. Which one should I change to make it work ? Or could you tell me which folder is the Tidb-server configuration file in, and what`s it named ? – Narcism Dec 05 '18 at 17:08
  • The TiDB configuration file is located in the {{ deploy_dir }}/conf directory of the TiDB node. The deploy_dir variable can be queried in tidb-ansible/inventory.ini. last_tikv.toml is the configuration recorded when TiKV was last started. TiKV will be compared with {{ deploy_dir }}/conf/tikv.toml and last_tikv.toml every time it starts. An error will occur when there are parameters that are not allowed to be modified. TiDB and TiKV are different components. – Bo Liu Dec 18 '18 at 03:10