01 December 2010

Terminal and PATH

After installing the latest MySQL for education/testing to my Mac I noticed I still needed to add the mysql/bin directory to my $PATH. I thought okay this should be simple to do right? But, following a mind numbing searching through a bunch of .shell_name_profile_info files in my home directory I became frustrated. So where is the correct place to store a new path for just installed software (assuming it didn't do it for me?)

The final answer should be simple right? Well, (and I'm lying here) it depends, who do you want to have easy access to the new path? For instance if you use su - and you add the path to just your stuff your out of luck when root or any other user is trying to get things started.


Info for Mac OS X 10.6:
I like TextMate but vi is free and included. (info on using vi)

Strictly You PATH:(or the person you are logged in as)
vi ~/.profile
edit or add if it's not already there
export PATH="/path/you/want/to/add:$PATH"
and save the file.

All User PATH:
go to
cd /etc/paths.d
make a new file
sudo vi mysql(SoftwareName)
enter your new path
/usr/local/mysql/bin
and save the new file

And because I'm still somewhat new to this if anyone has info on the proper place to setup PATH just for root please let me know and I'll add it in. Thanks.
Related Posts Plugin for WordPress, Blogger...