4
votes

I uninstalled newest mysql and tried to install mysql 5.7 on Mac by downloading from offical website, however it said the previous version is still installed on my Mac. I tried all methods I found, and they didn't work. I also couldn't found any mysql files on my Mac. So I installed mysql using home brew. And the path is {/usr/local/Cellar/[email protected]/5.7.29}. I followed some method and opened bash_profilescreenshot

I changed path to {/usr/local/Cellar/[email protected]/5.7.29/bin}, and I still got a command not found. I once also get mysql running by using {brew services start [email protected]}, but when I type {mysql -u root -p} it showed: " /usr/local/mysql/bin/mysql: No such file or directory".

Really appreciate it if anyone know what's the problem here.

2

2 Answers

10
votes

i had this problem too. looks like the installer isn't creating the symlink for some reason. this should fix it.

cd /usr/local/bin
ln -s ../Cellar/[email protected]/5.7.29/bin/mysql mysql
0
votes

As Homebrew says

[email protected] is keg-only, which means it was not symlinked into /usr/local, because this is an alternate version of another formula.

If you need to have [email protected] first in your PATH, run:

  echo 'export PATH="/usr/local/opt/[email protected]/bin:$PATH"' >> ~/.zshrc

Reload zsh config after installed.

source ~/.zshrc

Or open a new terminal.