MySQL command line with OS X 10.6.

17 01 2011

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
/usr/local/mysql/bin

to the file, saved, exited, restarted the terminal …. and voila, solved.

About these ads

Actions

Information

7 responses

28 07 2011
tureeya

great! had the same issue and found it really helpful.. thanks…

24 03 2012
Philip

Thanks it works like a charm :)

16 05 2012
JK

worked for me; thanks dood

6 11 2012
gabe

great help thanks!

21 12 2012
hk

how to exit it and save it

21 12 2012
rforge

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).

15 02 2013
Jatin

Thanks a ton. Very simple solution which I could not get anywhere else or think of.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s




Follow

Get every new post delivered to your Inbox.

%d bloggers like this: