Mac 下按照官网说明 安装 mongodb 并配置好PATH
后直接mongo
会报错:
|
好在 Stackoverflow 一个答案提到,是因为没有启动 mongodb service:
Did you run mongod before running mongo?
I followed installation instructions for mongodb from http://docs.mongodb.org/manual/tutorial/install-mongodb-on-os-x/ and I had the same error as you only when I ran mongo before actually running the mongo process with mongod. I thought installing mongodb would also launch it but you need to launch it manually with mongod before you do anything else that needs mongodb.
不过还是报错:
|
看见lock file
习惯性想去删掉,结果依然不行
最后还是在 Stackoverflow 找到解决方法:
|
开启mongod
后再mongo
就可以了
|
感觉 mongodb 的官方文档有点掉链子啊…