我必须将我的mysql bin添加到OSX 10.9.3中的$ PATH。 在谷歌搜索时,我发现以下guide告诉我在/ etc / paths文件中添加一行。
我尝试了这个,但我的$ PATH没有更新。我尝试重新启动终端,注销并重启,但似乎没有任何帮助。
这是我/ etc / paths的样子:
~ Pantera$ cat /etc/paths
/usr/bin
/bin
/usr/sbin
/sbin
/usr/local/bin
/usr/local/mysql/bin
/usr/local/mysql-5.7.9-osx10.9-x86_64/bin
但是当回显$ PATH时,最后2行不会被添加。
~ Pantera$ echo $PATH
/usr/local/opt/ruby193/bin:/usr/local/bin:/usr/local/sbin:/usr/local/opt/ruby193/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
我错过了什么步骤?
- 编辑 -
问:
~ Pantera$ /usr/libexec/path_helper
PATH="/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/mysql/bin:/usr/local/mysql-5.7.9-osx10.9-x86_64/bin:/usr/local/opt/ruby193/bin:/usr/local/sbin"; export PATH;
所以似乎包含了路径但是在尝试command not found
命令时终端仍然给了我mysql
。
/ etc / profile
的内容~ Pantera$ cat /etc/profile
# System-wide .profile for sh(1)
if [ -x /usr/libexec/path_helper ]; then
eval `/usr/libexec/path_helper -s`
fi
if [ "${BASH-no}" != "no" ]; then
[ -r /etc/bashrc ] && . /etc/bashrc
fi
export MSF_DATABASE_CONFIG=/usr/local/share/metasploit-framework/config/database.yml
export MSF_DATABASE_CONFIG=/usr/local/share/metasploit-framework/config/database.yml
〜/ .bash_profile的内容
~ Pantera$ cat ~/.bash_profile
PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
PATH=/usr/local/opt/ruby193/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
export MSF_DATABASE_CONFIG=/usr/local/share/metasploit-framework/config/database.yml
PATH=/usr/local/bin:/usr/local/sbin:/usr/local/opt/ruby193/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
PATH=/usr/local/opt/ruby193/bin:/usr/local/bin:/usr/local/sbin:/usr/local/opt/ruby193/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
export MSF_DATABASE_CONFIG=/usr/local/share/metasploit-framework/config/database.yml