I recently installed MySQL on a new Mac OS 10.6.1 Snow Leopard system. MySQL seems to be running according to the control panel and the output of ps aux | grep mysql. However, on the command line the mysql command is not available because (I think) the dir /usr/local/mysql/bin is not in the PATH.

I could add this to /etc/bashrc...

export PATH=$PATH:/usr/local/mysql/bin

Yes, OK that worked.

But is that the right way to do it? Should I add it to /etc/profile instead? Or something else?

link|improve this question

feedback

2 Answers

up vote 2 down vote accepted

That is the correct way to do it. /etc/profile is for login or non-interactive shells

link|improve this answer
feedback

Another option is to set PATH in ~/.MacOSX/environment.plist. You can use RCEnvironment to edit environment.plist. One downside of environment.plist is that it doesn't expand environment variables, so you can't append to a variable. The upside is that it works for all applications, not just those run from a terminal.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.