Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

osx, mysql command goes in /var/empty

Tags:

mysql

macos

I just installed mysql with homebrew on mac OSX.

The very first thing I did after the installation was the following symlink: /usr/bin/mysql -> /usr/local/Cellar/mysql/5.5.15/bin/mysql

But if I type 'mysql', instead of having the mysql-client interface, I get into /var/empty/, exactly like if I was doing a cd /var/empty/

Why, and how can I fix this problem so that the mysql command execute the mysql client ?

like image 780
FMaz008 Avatar asked Dec 01 '22 01:12

FMaz008


2 Answers

This can occur if you're using zsh since it will drop you into a user's home directory just by typing their user name. So if mysql isn't in your path (which it wouldn't be since it's a keg only formula), but you have a mysql user, then this is the behavior you would see. You can force Homebrew to link mysql into your path with brew link --force mysql55.

like image 115
StudioStark Avatar answered Jan 03 '23 17:01

StudioStark


Does your shell have a 'mysql' alias, perhaps, which is malfunctioning? alias at the prompt will show any aliases that are set.

like image 32
Marc B Avatar answered Jan 03 '23 17:01

Marc B