I try to start mongodb with mongod. This is my error message:
I STORAGE [initandlisten] exception in initAndListen: 29 Data directory /data/db not found., terminating
So I tried to start it from my mongodb folder ( which has a folder with data , and this one has db in it) and still doesnt work. It got the same error message.
MongoDB requires a data directory to store all data. MongoDB’s default data directory path is the absolute path \data\db on the drive from which you start MongoDB. Create this folder by running the following command in a Command Prompt
md \data\db
You can specify an alternate path for data files using the --dbpath option to mongod.exe, for example
"C:\Program Files\MongoDB\Server\3.4\bin\mongod.exe" --dbpath d:\test\mongodb\data
If you are working on windows then for me the best link to follow is
https://docs.mongodb.com/manual/tutorial/install-mongodb-on-windows/
and same for Linux and OS X given inside Installation category within this link.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With