I have downloaded mongodb for windows.
I have a folder where I can find mongod.exe and mongos.exe.
I guess that monod.exe is good for starting the database server and mongos.exe is the shell that I can use to connect to the database and make queries and create databases.
When I run the command
mongod.exe
from the command line, I expect a result like "Started the database server – waiting for connection on port 27017" or something like in
this tutorial
Instead, I get the following output
{"t":{"$date":"2023-06-27T14:44:15.167+02:00"},"s":"I", "c":"NETWORK", "id":4915701, "ctx":"-","msg":"Initialized wire specification","attr":{"spec":{"incomingExternalClient":{"minWireVersion":0,"maxWireVersion":17},"incomingInternalClient":{"minWireVersion":0,"maxWireVersion":17},"outgoing":{"minWireVersion":6,"maxWireVersion":17},"isInternalClient":true}}}
{"t":{"$date":"2023-06-27T14:44:15.168+02:00"},"s":"I", "c":"CONTROL", "id":23285, "ctx":"thread1","msg":"Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'"}
{"t":{"$date":"2023-06-27T14:44:15.169+02:00"},"s":"I", "c":"NETWORK", "id":4648602, "ctx":"thread1","msg":"Implicit TCP FastOpen in use."}
{"t":{"$date":"2023-06-27T14:44:15.171+02:00"},"s":"I", "c":"REPL", "id":5123008, "ctx":"thread1","msg":"Successfully registered PrimaryOnlyService","attr":{"service":"TenantMigrationDonorService","namespace":"config.tenantMigrationDonors"}}
{"t":{"$date":"2023-06-27T14:44:15.173+02:00"},"s":"I", "c":"REPL", "id":5123008, "ctx":"thread1","msg":"Successfully registered PrimaryOnlyService","attr":{"service":"TenantMigrationRecipientService","namespace":"config.tenantMigrationRecipients"}}
{"t":{"$date":"2023-06-27T14:44:15.173+02:00"},"s":"I", "c":"REPL", "id":5123008, "ctx":"thread1","msg":"Successfully registered PrimaryOnlyService","attr":{"service":"ShardSplitDonorService","namespace":"config.tenantSplitDonors"}}
What do I do wrong?
2
Answers
i think you should read the proper documentation this the link of MongoDB Documation for windows
You did nothing wrong, you simply need to wait when running
mongod.exe
for the first time. Those are just logs of mongodb.Just wait and after a while you’ll get these in the output:
Here you can see that server has started and listening on localhost ipv4 address ("127.0.0.1") and waiting for connection on port 27017.
You can also look at better alternatives to start a mongodb server:
Extremely Easy Way: MongoDB Compass (Recommended)
Just download the executable file from the download page. Install and run it. It’s a MongoDB GUI.
A screen like this would appear. Copy the URI, and click on Connect.
Then a screen like this would appear. Click on the plus icon + to create a database and collection.
Easy Way – MongoDB Shell (mongosh)
Just download the zip file from the download page. Extract it. You will find an executable file named like mongosh.exe in the bin folder. Copy the whole path to the executable file like
C:UsersPRATHAMDownloadsmongosh-1.10.1-win32-x64bin
and add it to the path of your environment variables.Now just open your command prompt (or any other terminal) and run this command:
Then just in a few simple steps you can start your mongodb server.