can't access mysql from command line mac

Michael Insalaco picture Michael Insalaco · Nov 19, 2011 · Viewed 169.1k times · Source

mysql on os x 10.6 is located in /usr/local/mysql/bin/mysql

I get command not found when I type mysql --version in the terminal. Is this because the socket path is wrong? if so how do I fix it?

thanks

Answer

sascha picture sascha · Nov 19, 2011

Just do the following in your terminal:

echo $PATH

If your given path is not in that string, you have to add it like this: export PATH=$PATH:/usr/local/ or export PATH=$PATH:/usr/local/mysql/bin