After installing MySQL 5.1.54 on Mac OS X 10.6.6 (Snow Leopard) I tried to access the server in the terminal and got:
-bash: mysql: command not found
Bash could not find the path, so I had to add it. I am not that familiar with the internals of the unix terminal anyway, so I found a highly informative thread on superuser.com.
Especially the post of Jim Logan solved the issue:
Take a look at the file /etc/paths, which is used by /usr/libexec/path_helper, which is used by /etc/profile. For MacPorts, use “sudo” to append “/opt/local/bin” to the end of the /etc/paths file and reopen the terminal window.
So I opened the terminal and used nano:
sudo nano /etc/paths
and appended the line
to the file, saved, exited, restarted the terminal …. and voila, solved.
11 thoughts on “MySQL command line with OS X 10.6.”
great! had the same issue and found it really helpful.. thanks…
Thanks it works like a charm 🙂
worked for me; thanks dood
great help thanks!
how to exit it and save it
If you used nano then Ctrl-O saves and Ctrl-X exits. Might be that on Apple keyboard it is Cmd-O and Cmd-X (Cmd for the “Apple”-key).
Thanks a ton. Very simple solution which I could not get anywhere else or think of.
but I still have the same problem
Then the path is not correct or changed. Try
I dropped my Mac for a clean LinuxPC a dreadfully ugly Dell — the lack of flexibility in the OS X plastic zoo was even more anoying 🙂 My point is I might not be so much of a help with the OS X/ BSD commandline… googling along the lines of “PATH variable mysql mac os x” should give you a lot of help. Good luck.
exactly what I needed thanks