Soumya Mahapatra
Soumya Mahapatra

Reputation: 27

MongoDB installation error-INSTALL_FAILED- dbpath (C:\mongodata) does not exist

I am trying to install MongoDB in my windows and getting the above error in my command prompt after typing the command:

mongod --dbpath "C:\mongodata"

But getting this error:

ERROR: dbpath (C:\mongodata) does not exist. Create this directory or give existing directory in --dbpath. See http://dochub.mongodb.org/core/startingandstoppingmongo

What am I doing wrong here?

Upvotes: 2

Views: 37

Answers (1)

Tyler Angelo
Tyler Angelo

Reputation: 105

You have to create the directory and then run the command. Mongo doesn't do it for you for some reason. As seen here under their documentation: "If you want mongod to store data files at a path other than /data/db you can specify a dbPath. The dbPath must exist before you start mongod. If it does not exist, create the directory and the permissions so that mongod can read and write data to this path. For more information on permissions, see the security operations documentation."

Upvotes: 0

Related Questions