时间:2021-07-01 10:21:17 帮助过:2人阅读
这里假设放置在/users/xxx/mongoDb下
2、在/users/xxx/mongoDb下新建data文件夹,在data下新建db文件夹 3、设置权限,输入sudo chown -R /users/xxx/mongoDB/mongodb-osx-x86_64-3.0.5/data 4、进入/users/xxx/mongoDB/mongodb-osx-x86_64-3.0.5/bin目录,设置db文件夹的路径命令,输入并回车,mongod --dbpath /Users/skythinking/MongoDB/mongodb-osx-x86_64-3.0.5/data/db 5.此时应看到waiting for connections on port 27017 6.浏览器查看localhost:27017,看到It looks like you are trying to access MongoDB over HTTP on the native driver port 说明已连接。 环境变量设置: 输入sudo nano ~/.bash_profile 输入登录密码export LO_HOME=/usr/local
export XYE_HOME=/users/xy
export PATH=${PATH}:${LO_HOME}/mysql/bin
export PATH=${PATH}:${LO_HOME}/bin
export PATH=${PATH}:${XYE_HOME}/mongoDB/mongodb-osx-x86_64-3.0.5/bin
录入示例如上。
control+o 保存
control+x 退出
source ~/.bash_profile 重新生效 echo $PATH 查看环境变量Mac OS下安装MongoDB
标签: