适用MongoDB过程遇到打不开的问题,细查之下是bash_profile zshrc 配置生效问题
基本知识:
tip1.bash_profile 中修改环境变量只对当前窗口有效,而且需要 source ~/.bash_profile才能使用
tip2.zshrc 则相当于开机启动的环境变量
首先解决bash_profile生效问题
1.vi ~/.zshrc 打开terminal后,在最后一行加入 source ~/.bash_profile
2.输入:wq 退出。
另外切换shell的方法:
chsh -s /bin/bash //切换到bash
chsh -s /bin/zsh //切换到zsh
如果输入密码后提示no change made,那么命令前加上sudo获取临时管理员权限
然后在启动MongoDB
1.开启mongo的服务端和客户端即可
注意:要在新的终端中使用mongo命令打开客户端
2.在navigate中可以看到正在使用的MongoDB了。