Alex
Alex

Reputation: 1028

MongoDB - mongo command runs but mongod doesn't

I have a MEAN droplet on digital ocean and I've found that when I run the mongo command I connect to test successfully and have access to my other databases, but if I try to run the mongod command I get the following message:

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

How is this possible? I thought mongo was connecting to a specific instance of mongod.

I will create the /data/db folder, but I feel like I might just be ignoring another problem with setup configuration that has allowed this to happen.

Upvotes: 0

Views: 565

Answers (1)

Minh Thành
Minh Thành

Reputation: 143

/data/db will be the place you store your database data. After you created that folder, you can run mongod as normal.

The mongod is a command to start mongodb server. And mongo is a command line interface to make you community with mongodb server. So you should start the server -> community with server.

Upvotes: 1

Related Questions