tags:

views:

26

answers:

3

I've installed mysql on several macs and on one of them mysql is not in the path. If I export it it shows up in the path correctly, but upon reboot, disappears. What should I do to get the machine to keep it in the path and what are the machines that DO have it in their path doing differently?

Any thoughts appreciated.

+1  A: 

if it is linux you have to add this export to your profile script. if windows edit PATH in My Computer | Properties | Edit environmental variables

Andrey
where is my profile script?
Dr.Dredel
/home/youruser/.bash_profileadd export line there
Andrey
+1  A: 

To one of your init files (such as /home/username/.bash_profile) add a line like:

export PATH=/path/to/mysql_folder:$PATH
Chibu
none of the macs (listed in the question) have a .bash_profile file in ~/ directory... so, I can create such a file, but somehow it's working currently without it on all but one of the machines
Dr.Dredel
I up-ticked your answer as it did solve my immediate problem, but the answer to where the other machines had their path set was provided by Slokun, so, I gave him the checkmark.
Dr.Dredel
+2  A: 

Check the /etc/profile file on the macs it's working on. The path file should be defined there, which would be for all users. The ~/.bash_profile mentioned is for an individual user.

You should see something similar to the previously mentioned

export PATH=/path/to/mysql_folder:$PATH

in this file, though it may be a bit buried. If you don't see PATH defined here, try /etc/environment. Failing this, I'm not sure where else OS X would define the path variable, but being a Unix system, there is a common file read by all profiles where it sets it.

Once you find it, compare the definition on the machines it works on to the one it doesn't, and edit accordingly. If it looks the same, then something's amiss, and you should let us know.

Slokun
ah! that was it... thanks very much.
Dr.Dredel