1

I have the directory created "E:\Program Files\mongo\data\db" but I am still getting this error when starting mongod.exe

Of course I can specify the above directory via --dbpath but I thought that it uses \data\db by default and the error message is basically telling me to create something which already exists.

mongod --help for help and startup options
2015-01-04T12:40:57.485-0500 [initandlisten] MongoDB starting : pid=5552 port=27
017 dbpath=\data\db\ 64-bit host=AVA-413999-1
2015-01-04T12:40:57.486-0500 [initandlisten] targetMinOS: Windows 7/Windows Serv
er 2008 R2
2015-01-04T12:40:57.487-0500 [initandlisten] db version v2.6.6
2015-01-04T12:40:57.487-0500 [initandlisten] git version: 608e8bc319627693b04cc7
da29ecc300a5f45a1f
2015-01-04T12:40:57.487-0500 [initandlisten] build info: windows sys.getwindowsv
ersion(major=6, minor=1, build=7601, platform=2, service_pack='Service Pack 1')
BOOST_LIB_VERSION=1_49
2015-01-04T12:40:57.487-0500 [initandlisten] allocator: system
2015-01-04T12:40:57.487-0500 [initandlisten] options: {}
2015-01-04T12:40:57.487-0500 [initandlisten] exception in initAndListen: 10296
*********************************************************************
 ERROR: dbpath (\data\db\) does not exist.
 Create this directory or give existing directory in --dbpath.
Shiloh
  • 1,816
  • 4
  • 24
  • 29

1 Answers1

4

Quite simply, the path that you have created is not the /data/db path.

The path mentioned here is relative to your root directory, which isn't really something that you have access to on Windows (which is where I assume you're doing your development)

Luckily, mongo has an ability to explicitly pass in a directory when you start using --dbpath, which you seem to realize.

In short:

E:\Program Files\mongo\data\db != /data/db

as /data/db is an absolute path, not a relative path. As indicated by the starting /

For more information on exactly how Windows handles the root directory (/), I advise you to check out this question.

Community
  • 1
  • 1
Slater Victoroff
  • 21,376
  • 21
  • 85
  • 144