$PATH variable on Mac OS 10.6 Server keeps resetting back
In a terminal window I run:
export PATH=$PATH:/usr/local/mysql/bin>> ~/.bash_profile
Then when I开发者_开发知识库 echo $PATH the new path shows alright.
But if I close that window, open another window, the path disappears!
How to change the PATH variable?
The command you have will set the path and then put the output from that command at the end of your .bash_profile.
You want to put the command itself into the .bash_profile.
echo 'export PATH=$PATH:/usr/local/mysql/bin' >> ~/.bash_profile
It won't take effect until you start a new terminal session.
You don't need to start a new Terminal session in order to apply the changes to the ~/.bash_profile.
Just type in the Terminal
source ~/.bash_profile
You need to save the
export PATH=$PATH:/usr/local/mysql/bin
in the .bash_profile, as you're trying. However, the export statement is not just displayed text, so appending it won't work. Use an editor to do it.
精彩评论