This probably most of the MAC users must be knowing, but still would like to document it.:
I had a pain myself figuring the way out. Following is the way(or should i say PATH??) to do it:
- In your terminal, type cd /etc/paths.d/
- touch mysql(this could be any name)
- sudo vi mysql
- [press i to insert] type in the path u want to append to the $PATH variable. In my case i wanted to set mysql’s path. So i had to type(copy paste rather) /usr/local/mysql/bin
- [esc] :wq! to save the file.
U are done..
There is another way to set up $PATH, which is rather simple but wont be persisted with new sessions(new terminal or terminal tab).
To do so, in terminal u can just say export PATH=$PATH:<the path u want to append>
for ex., PATH=$PATH:/usr/local/mysql/bin