Tiup Command Not Found

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

Original topic: Tiup命令找不到

| username: TiDBer_HNYxjs3i

The TiDB user used to install tiup, but every time after restarting, using the TiDB user to execute the tiup command still results in an error saying it cannot be found. I would like to ask everyone, what is the reason for this?

| username: TiDBer_小阿飞 | Original post link

Have the environment variables taken effect? If not, just cd to the root directory of tiup and execute tiup.

| username: WalterWj | Original post link

After adding it to the environment variables, it’s still not working? That’s so strange!

| username: TiDBer_HNYxjs3i | Original post link

Every time I install tiup, I execute source .bash_profile. As a result, this file contains many identical lines. Executing source should already make the environment variables take effect, right?

| username: TiDBer_HNYxjs3i | Original post link

I just started learning about TiDB. It might have been caused by my incorrect operation, maybe…

| username: 这里介绍不了我 | Original post link

Why is it exporting so much?

| username: TiDBer_HNYxjs3i | Original post link

Because the virtual machine was restarted many times and the .bash_profile was sourced many times, many entries appeared…

| username: TiDBer_小阿飞 | Original post link

Is it an offline or online environment?
Have the offline packages been merged?
Is there any output when you enter which tiup under the tidb user?

If using bash and as the tidb user, add export PATH=/home/tidb/.tiup/bin:$PATH to ~/.bashrc and then execute source ~/.bashrc. Adjust accordingly based on the shell and user being used.

| username: TiDBer_QHSxuEa1 | Original post link

You probably need to source it, right?
Check which user was used for the installation. If it was the tidb user, then:
su tidb
cd
source .bash_profile
See if it works.

| username: TiDBer_HNYxjs3i | Original post link

I have already executed source, but the issue of the tiup command not being found still occurs.

| username: TiDBer_HNYxjs3i | Original post link

It was installed online.

| username: DBAER | Original post link

Find it first, it should be an environment variable issue.

| username: TiDBer_HNYxjs3i | Original post link

Yes, it should be an issue with the environment variables.

| username: TiDBer_HNYxjs3i | Original post link

The problem is solved. I would like to ask why it was changed this way… I followed the steps on the official website step by step…

| username: TiDBer_小阿飞 | Original post link

Either the tiup tool was not installed successfully, or the environment variables were configured incorrectly. Please check.

| username: gary | Original post link

Re-execute local_install for the TiDB user, then source the environment variables again.

| username: TiDBer_HNYxjs3i | Original post link

I saw on the official website that it mentions .bash_profile, so I have always been configuring this file.

| username: TiDBer_小阿飞 | Original post link

The reason is that your tiup executable path is not correctly added to the system’s environment variables. You need to manually modify the path in the environment variables.

| username: zhaokede | Original post link

The user changed or did not configure it correctly in the environment variables.

| username: BraveChen | Original post link

This is not a TiDB issue, it’s a Linux issue :stuck_out_tongue_closed_eyes: