Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I am trying to install MongoDB and I get this error "Data directory C:\data\db\ not found., terminating"

Tags:

mongodb

nosql

I am trying to install MongoDB, but I having some difficulties I get this

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 decide to create the db folder within the DB folder and I input this 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 have created the file. I don't understand the problem.

like image 937
Mila Avatar asked May 10 '16 00:05

Mila


1 Answers

There is a space in your command

`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"
like image 71
Nisha Avatar answered Oct 22 '22 18:10

Nisha