Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
.bashrc 说:
PATH=$PATH:/usr/local/mysql/bin/:$HOME/.rvm/bin # Add RVM to PATH for scripting
但mysql -u root返回
mysql -u root
-bash: mysql: command not found
但如果我这样做/usr/local/mysql/bin/mysql -u root 一切正常。为什么不使用 PATH 进行搜索?
/usr/local/mysql/bin/mysql -u root
谢谢
您需要使用:
export PATH=$PATH:...
或者export PATH在此语句之后添加语句。
export PATH
您所做的更改不会在您的.bashrc. export在分配之前添加(或export PATH稍后添加)将确保您的更改导出到 shell 的子进程。
.bashrc
export