I'm trying to install mongodb on my window 7 machine. When trying to start it by using the mongod command I get this error. dbpath (\data\db) does not exist. I followed the steps ath the tutorial. All the folders exist C:\mongodb\log
, C:\mongodb\data and
C:\mongodb\data\db
.
相关问题
- MongoDB can not create unique sparse index (duplic
- How to Debug/Register a Permanent WMI Event Which
- the application was unable to start correctly 0xc0
- Spring Data MongoDB - lazy access to some fields
- Golang mongodb aggregation
相关文章
- mongodb有没有什么办法禁止读取数据的时候进行缓存
- mongodb-aggregate聚合查询分组后如何获得多字段
- mongodb error: how do I make sure that your journa
- How to track MongoDB requests from a console appli
- MongoError: cannot infer query fields to set, path
- Pymongo $in Query Not Working
- django.core.exceptions.ImproperlyConfigured: '
- Looking for documentation on the “right” way to in
In windows you might not have permission for your user. And mongo installer could not create it because of lack of Administrative permission for your user.
So in C:\Program Files\MongoDB:
That's it :)
The default path is c:\data\db. You are trying to use c:\mongodb\data\db.
This means you have to use the option --dbpath c:\mongodb\data\db for mongod command.
By default, when we start the mongodb, it looks for the folder
/data/db
(on Mac/Linux) orC:\data\db
(on windows)...however, during the installation it doesn't create this folder, so when when we run mongodb for the first time, it fails with the error that it can't findC:\data\db
folder. The solution is to manually createC:\data\db
folder and then start mongodb. This error can be totally avoided if the mongodb installer can just give an option to choose this folder path and then create it as part of mongodb installation itself.Try to use 2 command Prompts (CMD) at the same time.
First CMD, use the command: mongod (or mongod --dbpath C:\mongodb\data)
Second CMD, use the command: mongo
The second will connect in the database. Do not close the first.