通过brew安装了mysql,但终端找不到它。在 Macos 上给它起别名的正确方法是什么?

aaa*_*dre 6 mysql macos bash homebrew

macOS 10.12.6

通过brew安装mysql

mysql 文件位于 /usr/local/Cellar/mysql\@5.7/5.7.24/bin

从命令行和 bash 获取这些内容的正确方法是什么?

谢谢你!

Ort*_*kni 7

使用以下命令给出问题的解决方案:

brew info mysql@5.7
Run Code Online (Sandbox Code Playgroud)

其中指出:

If you need to have mysql@5.7 first in your PATH run:
echo 'export PATH="/usr/local/opt/mysql@5.7/bin:$PATH"' >> ~/.bash_profile
Run Code Online (Sandbox Code Playgroud)