Skip navigation

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

One Comment

  1. 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.

Leave a Reply

Your email address will not be published. Required fields are marked *


× eight = 24

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>