MongoDB Data directory /data/db not found [duplicate] MongoDB Data directory /data/db not found [duplicate] mongodb mongodb

MongoDB Data directory /data/db not found [duplicate]


MongoDB needs data directory to store data.Default path is /data/db

When you start MongoDB engine, it searches this directory which is missing in your case. Solution is create this directory and assign rwx permission to user.

If you want to change the path of your data directory then you should specify it while starting mongod server like,

mongod --dbpath /data/<path> --port <port no> 

This should help you start your mongod server with custom path and port.