.bashrc 说:
PATH=$PATH:/usr/local/mysql/bin/:$HOME/.rvm/bin # Add RVM to PATH for scripting
但是mysql -u root
返回
-bash: mysql: command not found
但是如果我这样做/usr/local/mysql/bin/mysql -u root
一切正常。为什么不使用 PATH 进行搜索?
谢谢
最佳答案
您需要使用:
export PATH=$PATH:...
或者在此语句后面添加export PATH
语句。
您所做的更改不会在 .bashrc
执行之后继续存在。稍后在分配之前添加 export
(或 export PATH
)将确保您的更改导出到 shell 的子进程。
关于mysql:找不到命令,但它在我的路径中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14160375/