brew install mongodb
2021-04-29 15:02
417 查看
install
安装请参考:
https://www.geek-share.com/detail/2794356964.html
//启动 brew services start mongodb-community //停止 brew services stop mongodb-community //重启 brew services restart mongodb-community
验证是否启动成功:
终端输入mongo启动客户端, 最后能到输入mongodb命令的状态,按ctrl+c退出 or quit() ;
浏览器访问:http://localhost:27017/
页面提示:It looks like you are trying to access MongoDB over HTTP on the native driver port.
user
在终端进入
-
mongo
-
创建一个账号
use admin db.createUser( { user: "user1", pwd: "user1", roles: [ { role: "userAdminAnyDatabase", db: "admin" }, { role: "dbAdminAnyDatabase", db: "admin" }, { role: "readWriteAnyDatabase", db: "admin" } ] } )
mongo --port 27017 -u "user1" -p "user1" --authenticationDatabase "admin"
相关文章推荐
- Install MongoDB on FC6
- Install MongoDB on Red Hat Enterprise, CentOS, Fedora, or Amazon Linux
- MongoDB Installaion
- mac 下用 brew 安装mongodb
- brew install mysql遇到错误
- brew install specific version of formula
- Install OpenCV3.1 on Mac by brew
- Mac下使用brew安装mongodb
- Mac下使用brew安装mongodb
- Install MongoDB in Ubuntu 16.04 LTS
- Install MongoDB on Red Hat Enterprise or CentOS Linux
- How To Install MongoDB On Mac OS X
- MAC系统中用brew install maven安装MAVEN
- brew cask install 解决慢的问题
- MongoDB install and use
- install the brew in mac
- mac 下用 brew 安装mongodb
- mac install brew
- brew install curl- (4) 错误
- Mac下pip安装pymssql报错“brew install freetds”解决