You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The databases are stored in the /usr/local/var/mongodb/ directory
The mongod.conf file is here: /usr/local/etc/mongod.conf
The mongo logs can be found at /usr/local/var/log/mongodb/
The mongo binaries are here: /usr/local/Cellar/mongodb/[version]/bin
官方文档:https://docs.mongodb.com/getting-started/shell/
Homebrew安装mongodb
默认的安装路径:
The databases are stored in the /usr/local/var/mongodb/ directory The mongod.conf file is here: /usr/local/etc/mongod.conf The mongo logs can be found at /usr/local/var/log/mongodb/ The mongo binaries are here: /usr/local/Cellar/mongodb/[version]/bin
启动
mongod --config /usr/local/etc/mongod.conf # 或者 mongod --config /usr/local/etc/mongod.conf --fork
其中mongod.conf内容如下:
systemLog: destination: file path: /usr/local/var/log/mongodb/mongo.log logAppend: true storage: dbPath: /usr/local/var/mongodb net: bindIp: 127.0.0.1
直接输入mongo或者下面的过程:
cd /usr/local/bin //进入数据库目录 ./mongo //连结数据数据库 show dbs //列出数据库 use school //切换到school数据库,如果没有此数据库则创建此数据库
The text was updated successfully, but these errors were encountered: