$PATH not being saved after I leave terminal

If anyone is using MacOs BigSur you should run open ~/.zshrc ` and type the

export PATH=

In my case this was

export PATH=/Applications/MAMP/bin/php/php7.3.24/bin/:$PATH


You have to add

PATH=${PATH}:/usr/local/mysql/bin
export PATH

to your ~/.bash_profile or .bashrc (or use similar option when using different shell).

If you want it to be system wide, you should upgrade: /etc/bash.bashrc (on archilnux, can wary on your distribution)


Then do not forget to run following command for bash to implement the current path without restarting:

source ~/.bash_profile 

At the end you can try this command to check if path correctly implemented:

echo $PATH

it will show the content of your PATH, ideally you should find your new path there.


edit your ~/.bash_profile

and put the line:

export PATH=$PATH:/usr/local/mysql/bin