Forgot root password

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

Original topic: 忘记root密码

| username: TiDBer_7Q5CQdQd

After I used kill -9 to terminate the process, it automatically restarted without waiting for me to restart it. Besides, I don’t know how to restart it.
Using sh run_tidb.sh also reported an error.

| username: changpeng75 | Original post link

After the automatic restart, did you execute sh run_tidb.sh again?

| username: zhanggame1 | Original post link

You should be able to change it by modifying the configuration and then restarting.

| username: wangccsy | Original post link

Got it.

| username: 哈喽沃德 | Original post link

Is it possible that the configuration file was corrupted?

| username: dba远航 | Original post link

First, modify the configuration file.

| username: 数据库真NB | Original post link

First, modify the configuration file, then restart. I hope your connection tool remembers the password by default.

| username: forever | Original post link

The error message indicates that an instance already exists. After modifying the parameters and killing the process, it automatically restarted. You can directly change the password.

| username: zhang_2023 | Original post link

I just encountered this as well and learned from it.

| username: ShawnYan | Original post link

Reference

| username: ffeenn | Original post link

In this article, the method of stopping the tidb-server service using kill -9 needs to be optimized. The correct method should be to use the system service command systemctl stop tidb-server-4000 to stop it, because the TiDB server depends on this service. Using kill to stop it is not advisable and can lead to many restart-like situations. The correct order for changing the password should be to first stop the service using systemctl, then modify the configuration, start the tidb-server using a script, and finally, after changing the password and restoring the previous configuration, start the tidb-server service using systemctl. Alternatively, you can use tiup to start the service.