如果有人可以在这里提供一些见解,我将非常感谢。
If someone can provide some insights here I would GREATLY appreciate it.
我是MongoDB的新用户,并且是(相对)新的命令行。
I am new to MongoDB, and (relatively) new to the command line.
我有一个express / node.js应用程序在MongoDB本地成功运行,但重新启动我的计算机后,我试图重新启动Mongo服务器,它开始给错误和开始。从那时起,我重新安装了Mongo几次才发现相同的错误。这是我收到的:
I had a express/node.js app running on MongoDB locally successfully, but upon restarting my computer, I attempted to restart the Mongo server and it began giving errors and wouldn't start. Since then, I have re-installed Mongo several times only to find the same error occurring. this is what I am receiving:
privee:mongodb-osx-x86_64-2.4.6 jonlinton$ ./bin/mongo MongoDB shell version: 2.4.6 connecting to: test Mon Aug 26 14:48:47.168 Error: couldn't connect to server 127.0.0.1:27017 at src/mongo/shell/mongo.js:145 exception: connect failed我缺少一个步骤吗?我应该创建一个配置文件吗?一些基本的指导将是非常有帮助的。预先感谢任何见解。
Am I missing a step? Should I be creating a config file? Some basic guidance would be really helpful. Thanks in advance for any insights.
推荐答案假设您在安装后已经在bin下创建了data / db目录。
Assuming you have created the data/db directory under bin after install.
运行命令
Run the command
./ mongod
./mongod
为您的mongo shell启动一个终端
Start a terminal for your mongo shell
运行命令(确保输入数据库的名称)
Run the command (make sure you put the name of the database)
./ mongo test
./mongo test
更多推荐
在OSX上安装和运行MongoDB
发布评论