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
Advertisement
Posted by Siddhant on February 23, 2010 at 9:56 pm
You could put the export statement inside .bash_profile (or .bashrc for that matter; .bash_profile on my system is just sourcing .bashrc) as well. That’ll make it persistent.
Posted by Installing ruby-pg on MAC Snow Leopard | Anooj's weblog on June 23, 2011 at 1:26 pm
[...] machine and the path to the postgres bin folder is in the $PATH enviroment variable. You can follow http://anooj.me/blog/?p=64 to set [...]