我安装了MongoDB并使用dbpath
设置数据路径。当我尝试运行mongo.exe
文件时,我收到以下错误。
C:\Program Files\MongoDB\Server\3.0\bin>mongo.exe
MongoDB shell version: 3.0.15-17-g0941b8e
connecting to: test
2017-11-19T09:09:11.726+0530 W NETWORK Failed to connect to 127.0.0.1:27017 after 5000 milliseconds, giving up.
2017-11-19T09:09:11.729+0530 E QUERY Error: couldn't connect to server 127.0.0.1:27017 (127.0.0.1), connection attempt failed
at connect (src/mongo/shell/mongo.js:179:14)
at (connect):1:6 at src/mongo/shell/mongo.js:179
exception: connect failed
答案 0 :(得分:1)
尝试从c:/ Program Files / MongoDB / Server / 3.0 / bin中的cmd行运行'mongod.exe',然后在mongod运行时运行mongo.exe。