If you attempt to start a
mongod with a
--dbpath that contains data files produced by a storage engine other than the one specified by
mongod will refuse to start.
The -dbpath is the path parameter , which mongod server check to startup.
-dbpath <path> should be
\data\db on Windows environment.
As per you log you are trying to connect Local MongoDB Instance on Default port (that is
Let's start from the beginning, after installation of
MongoDB . How to connect MongoDB with
Note: Make sure before starting the mongod server and mongo shell , you have created the by default path of MongoDB like
\data\db in your
As MongoDB Documented here
mongod is the primary daemon process for the MongoDB system. It handles data requests, manages data access, and performs background management operations.
To connect to a MongoDB instance running on localhost with default port 27017:
At a prompt in a terminal window (or a command prompt for Windows),
go to your
<mongodb installation dir>:
cd mongodb installation dir
For example in my environment it will be
Note: By default MongoDB installation directory is
Files\MongoDB\Server\x.x\bin . In my place
C:\Program Files\MongoDB\Server\3.6\bin. Here x.x indicates the version number
- to start mongo:
if you added the
<mongodb installation dir>/bin to your
PATH you can run
Suppose that i want to run mongo shell , so in my place the command should be like that
After running the mongo shell , you shall find the some information like that as mention below.
MongoDB shell version v3.6.0
connecting to: mongodb://127.0.0.1:27017
MongoDB server version: 3.6.0
Server has startup warnings:
2018-03-16T19:57:55.861+0530 I CONTROL [initandlisten]
2018-03-16T19:57:55.862+0530 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database.
2018-03-16T19:57:55.862+0530 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted.
2018-03-16T19:57:55.862+0530 I CONTROL [initandlisten]
2018-03-16T19:57:55.863+0530 I CONTROL [initandlisten] ** WARNING: This server is bound to localhost.
2018-03-16T19:57:55.863+0530 I CONTROL [initandlisten] ** Remote systems will be unable to connect to this server.
2018-03-16T19:57:55.865+0530 I CONTROL [initandlisten] ** Start the server with --bind_ip <address> to specify which IP
2018-03-16T19:57:55.865+0530 I CONTROL [initandlisten] ** addresses it should serve responses from, or with --bind_ip_all to
2018-03-16T19:57:55.865+0530 I CONTROL [initandlisten] ** bind to all interfaces. If this behavior is desired, start the
2018-03-16T19:57:55.868+0530 I CONTROL [initandlisten] ** server with --bind_ip 127.0.0.1 to disable this warning.
2018-03-16T19:57:55.870+0530 I CONTROL [initandlisten]
2018-03-16T19:57:55.871+0530 I CONTROL [initandlisten] Hotfix KB2731284 or later update is not installed, will zero-out data files.
2018-03-16T19:57:55.873+0530 I CONTROL [initandlisten]
2018-03-16T19:57:55.874+0530 I CONTROL [initandlisten] ** WARNING: The file system cache of this machine is configured to be greater than 40% of the total memory. This can lead to increased memory pressure and poor perf
2018-03-16T19:57:55.876+0530 I CONTROL [initandlisten] See http://dochub.mongodb.org/core/wt-windows-system-file-cache
2018-03-16T19:57:55.877+0530 I CONTROL [initandlisten]
Note: The above mongo shell warning message information is in My environment. which is based on
MongoDB 3.6 version. May be in your environment this message will be different. It's vary to version of MongoDB , which comes by default from
If you shall get look like this mongo shell
> command prompt. That's means you have successfully connected with
For your confirmation check with in
mongo shell , to type command like.
You shall get the all databases in MongoDB.
> show dbs
If you shall get databases information in your
mongo shell prompt that means you have successfully connected with
Note: By default MongoDB shows
test database. And By default mongo shell connect with
test database. For example, to check in mongo shell to type the command like that
For further your ref here and here