Question

This is listed in my .bash_profile

PATH="/usr/local/mysql/bin:/Applications/MAMP/Library/bin:$PATH"
export PATH

After applying those changes with ". .bash_profile", "which mysql" only outputs

/usr/local/mysql/bin

How do i get mysql to also look at /Applications/MAMP/... ?

Thanks in advance.

Was it helpful?

Solution

What is happening here is that mysql/bin is listed before the MAMP bin folder. The path is being evaluated from left to right, meaning that because which found mysql in the mysql/bin folder it is returning that one, without ever processing the other directories.

If you want the mysql binary to be found from the MAMP binary folder, then switch the order of your PATH to PATH="/Applications/MAMP/Library/bin:/usr/local/mysql/bin:$PATH"

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top