标签:路径 tray 简单 tar automake 默认 mongdb sheng --
在Mac上使用homebrew安装
更新Homebrew的package数据库:
brew update
安装:brew install mongodb
然后会出现下面这样
Updating Homebrew...
==> Downloading https://homebrew.bintray.com/bottles/mongodb-3.4.4.sierra.bottle
Already downloaded: /Users/liangma/Library/Caches/Homebrew/mongodb-3.4.4.sierra.bottle.tar.gz
==> Pouring mongodb-3.4.4.sierra.bottle.tar.gz
==> Using the sandbox
==> Caveats
To have launchd start mongodb now and restart at login:
brew services start mongodb
Or, if you don‘t want/need a background service you can just run:
mongod --config /usr/local/etc/mongod.conf
==> Summary
查看所有homebrew所安装的软件
js brew list
这时候在列表中会出现mongodb
xieyushengdeMacBook-Pro:~ xieyusheng$ brew list
autoconf icu4c libyaml openssl@1.1 watchman
automake libgpg-error mongodb pcre
coreutils libksba node pkg-config
flow libtool openssl readline
这就代表安装成功了
我们这还是通过homebrew来卸载
js brew uninstall mongodb
然后在查看brew list就不会出现mongdb的存在了
js mongod --config /usr/local/etc/mongod.conf
js mongo
show dbs
use dataone
(使用就自动创建)db
db.dataone.insert({"name":"xiaoming",age:12})
查数据 db.dataone.find()
mdb安装默认Mac安装路径:
/usr/local/mongodb
标签:路径 tray 简单 tar automake 默认 mongdb sheng --
原文地址:https://www.cnblogs.com/allenxieyusheng/p/8945374.html