I\'m trying to start mongo uin windows10 by type: mongo
in cmd.
I am getting this error:
C:\\Users\\Itzik>mongo
MongoDB shell versio
First start the server. Goto your installation path. Mine was in "Program Files/Mongodb/server/bin"
You will find a "mongod.exe" application.
However, the server will look for "C:/data" folder for all the databases. So create the "C:/data" folder.
Now start the mongod.exe using command prompt.
>>mongod
After this you may start the client
>>mongo
This worked out for me.
First set the path in Enviroment Variables, C:\Program Files\MongoDB\Server\3.6\bin
after that use bellow command
C:\>mkdir data
C:\>cd data
C:\data>mkdir db
C:\data\db>
Then go to bin directory and select mongod.exe
or use mongod
. Without closing previous cmd
open a new cmd and start the client using mongo
Now it will work.
I also have faced the same problem. First i have typed mongodb in my command prompt ,It displays "waiting for connection on 27017" that means it is working. Then i type mongo in another Command prompt Window then above error occurred.
I was having both .dll files in my xampp\php\ext folder. (php_mongo.dll and php_mongodb.dll) I deleted Php_mongodb.dll and also it's extension from php.ini file.
Again restart command prompt,Type mongod and then mongo Now working correctly.
Have you started the server? Mongodb follows a server-client architecture. mongo
is the client, but before it is started you need to start mongod
, which is the server.
If you haven't, start the server in advance in a different console:
mongod --dbpath "c:\data"
replacing c:\data by any folder where you want to store your data (you need to create the folder in advance).
If mongod
is not in the path look in the installation path, it should be something like C:\mongodb\bin\mongod.exe
.
When the server says something like 'waiting for connections', then you can go to another console and type mongo
to start the client.
if u install by brew (on osx)
first run sudo mkdir /data/db
start mondoDB Daemon by typing mongod
(leave it open) and then
run mongo by typing mongo
in new terminal tab
Running the command 'mongo' in another window shell worked for me in Windows, i ran 'mongod' correctly but I did not know to exit to run 'mongo' and access the console