安装
用homebrew安装
1 | brew update |
运行
1.create the data repository:1
sudo mkdir -p /data/db
2.run1
2
3
4
5
6
7
8
9
10
11//Run without specifying paths
mongod
//Specify the path of the mongod
<path to binary>/mongod
//Specify the path of the data directory
mongod --dbpath <path to data directory>
3.stop MongoDB
press Control+C in the terminal where the mongod instance is running.