I try to install MongoDB and I get this error "Data directory C: \ data \ db \ not found. Finishing"

I'm trying to install MongoDB, but I get this with some difficulties

C:\Users\HP>mongod
2016-05-09T19:48:32.489-0400 I CONTROL  [initandlisten] MongoDB starting : pid=4
284 port=27017 dbpath=C:\data\db\ 64-bit host=hp_pc
2016-05-09T19:48:32.490-0400 I CONTROL  [initandlisten] targetMinOS: Windows 7/W
indows Server 2008 R2
2016-05-09T19:48:32.490-0400 I CONTROL  [initandlisten] db version v3.2.6
2016-05-09T19:48:32.490-0400 I CONTROL  [initandlisten] git version: 05552b562c7
a0b3143a729aaa0838e558dc49b25
2016-05-09T19:48:32.490-0400 I CONTROL  [initandlisten] OpenSSL version: OpenSSL
 1.0.1p-fips 9 Jul 2015
2016-05-09T19:48:32.490-0400 I CONTROL  [initandlisten] allocator: tcmalloc
2016-05-09T19:48:32.490-0400 I CONTROL  [initandlisten] modules: none
2016-05-09T19:48:32.491-0400 I CONTROL  [initandlisten] build environment:
2016-05-09T19:48:32.491-0400 I CONTROL  [initandlisten]     distmod: 2008plus-ss
l
2016-05-09T19:48:32.491-0400 I CONTROL  [initandlisten]     distarch: x86_64
2016-05-09T19:48:32.491-0400 I CONTROL  [initandlisten]     target_arch: x86_64
2016-05-09T19:48:32.491-0400 I CONTROL  [initandlisten] options: {}
2016-05-09T19:48:32.492-0400 I STORAGE  [initandlisten] exception in initAndList
en: 29 Data directory C:\data\db\ not found., terminating
2016-05-09T19:48:32.493-0400 I CONTROL  [initandlisten] dbexit:  rc: 100
C:\Users\HP>

So, I decided to create the db folder in the DB folder, and I enter it into the command line

`mongod --dbpath C:\Program Files\MongoDB\Server\3.2\data\db`

However, I get an error

Invalid command: Files\MongoDB\Server\3.2\data\db

I created a file. I do not understand the problem.

+4
source share
2 answers

There is a gap in your team

`mongod --dbpath C:\Program Files\MongoDB\Server\3.2\data\db`

It should be

mongod --dbpath "C:\Program Files\MongoDB\Server\3.2\data\db"
+4
source

'test' is automatically created when mongodb is installed. Do you see the "test" folder? If yes, use below:

C:\Program Files\MongoDB\Server\3.0\bin>mongod.exe --dbpath d:\test\mongodb\data
0
source

All Articles