查看paht

  1. echo $PAHT

在最后,添加:

  1. # vim /etc/profile
  2. export PATH="/usr/local/webserver/mysql/bin:$PATH"

保存,退出,然后运行:

  1. #source /etc/profile

不报错则成功。

当然最好编辑~/.bash_profile,因为这个是对当前用户生效的,不会影响其他用户。
如下:

  1. vim ~/.bash_profile
  2. # .bash_profile
  3. # Get the aliases and functions
  4. if [ -f ~/.bashrc ]; then
  5. . ~/.bashrc
  6. fi
  7. # User specific environment and startup programs
  8. PATH=$PATH:$HOME/.local/bin:$HOME/bin
  9. ## add by kris
  10. export GOROOT=/usr/local/go
  11. export GOPATH=/usr/share/nginx/html/gopath
  12. export PATH=$GOPATH/bin:$GOROOT/bin:$PATH
  13. ## end by kris
  14. export PATH

同样保存运行source命令以使path生效。

分类: web

标签:   linux