Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: 忘记root密码
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.
After the automatic restart, did you execute sh run_tidb.sh again?
You should be able to change it by modifying the configuration and then restarting.
Is it possible that the configuration file was corrupted?
First, modify the configuration file.
First, modify the configuration file, then restart. I hope your connection tool remembers the password by default.
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.
I just encountered this as well and learned from it.
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.