刚刚在Mac上使用Ventura iOS安装了Mongodb社区v 6.0.5。这是我第一次使用MongoDB。它安装得很好,我可以看到版本,但当我尝试使用命令运行它时:
mongod --dbpath ./database
它只会打印出日志文件
{"t":{"$date":"2023-05-11T14:45:18.991-06:00"},"s":"I", "c":"CONTROL",
"id":4784929, "ctx":"initandlisten","msg":"Acquiring the global lock for shutdown"}
{"t":{"$date":"2023-05-11T14:45:18.991-06:00"},"s":"I", "c":"-",
"id":4784931, "ctx":"initandlisten","msg":"Dropping the scope cache for shutdown"}
{"t":{"$date":"2023-05-11T14:45:18.991-06:00"},"s":"I", "c":"CONTROL", "id":20565,
"ctx":"initandlisten","msg":"Now exiting"}
{"t":{"$date":"2023-05-11T14:45:18.991-06:00"},"s":"I", "c":"CONTROL", "id":23138,
"ctx":"initandlisten","msg":"Shutting down","attr":{"exitCode":48}}
它比那要长得多,但我想你明白了。我的咖啡是最新的。我可以尝试哪些不同的方法?
1条答案
按热度按时间icnyk63a1#
我想明白了当我运行
brew services list
时,mongodb的状态被列为12288错误。在进一步的research之后,我了解到这意味着mongodb已经在运行(这真的很令人困惑),并且在我的终端中运行mongo
或mongosh
命令应该会带来mongo shell。对我来说,mongosh
命令起作用了。不知道如何判断哪一个将工作在什么设备上,但谢天谢地,只有两个尝试从。