1. 最便捷的方式是采用port安装,
只需运行
sudo port install mongodb
port会自动将mongo,mongd等命令添加到你的系统路径中
2. 源代码安装
# make default directory for data $ mkdir -p /data/db # using curl, get the pre-built distro $ curl -O http://downloads.mongodb.org/osx/mongodb-osx-x86_64-latest.tgz # unpack $ tar xzf mongodb-osx-x86_64-latest.tgz