-1

Hello i have tried to write simple .sh bash script to start mongodb and connect my app to local mongoDB but receiving following error: exception in initAndListen: NonExistentPath: Data directory /data/db not found., terminating

after typing mongod. Do you have any guess what kind of error it is?

  • The error, as shown, means you don't have a data directory at `/data/db` - have you verified that the directory exists and that `mongod` has access rights to it? – David Makogon Feb 16 '19 at 14:25
  • solved it like in this post: https://stackoverflow.com/questions/13312358/mongo-couldnt-connect-to-server-127-0-0-127017systemctl start mongod systemctl enable mongod. – Максим Малин Feb 16 '19 at 14:31

1 Answers1

0

Create the /data/db folder and define it on mongod.cfg file.....you should also check

What is the default database path for MongoDB?

Daniel Sanin
  • 21
  • 2
  • 7