无法从命令行 mac 访问 mysql

2021-12-28 00:00:00 terminal mysql

os x 10.6 上的 mysql 位于 /usr/local/mysql/bin/mysql

mysql on os x 10.6 is located in /usr/local/mysql/bin/mysql

我在终端中输入 mysql --version 时找不到命令.这是因为套接字路径错误吗?如果是这样,我该如何解决?

I get command not found when I type mysql --version in the terminal. Is this because the socket path is wrong? if so how do I fix it?

谢谢

推荐答案

只需在终端中执行以下操作:

Just do the following in your terminal:

echo $PATH

如果给定的路径不在该字符串中,则必须像这样添加它:export PATH=$PATH:/usr/local/export PATH=$PATH:/usr/local/mysql/bin

If your given path is not in that string, you have to add it like this: export PATH=$PATH:/usr/local/ or export PATH=$PATH:/usr/local/mysql/bin

相关文章