Make Connection with MongoDB Server

Make Connection with MongoDB Server:

mongo looks for a database server listening on port 27017 on the localhost interface.
To connect to a server on a different port or interface, use the –port and –host options.

Run this : D:\mongodb\bin\mongo.exe

D:\mongodb\bin>mongo.exe
MongoDB shell version: 2.6.4
connecting to: test
Welcome to the MongoDB shell.
For interactive help, type “help”.
For more comprehensive documentation, see
        http://docs.mongodb.org/
Questions? Try the support group
        http://groups.google.com/group/mongodb-user
>
>

Connection from other machine:
————————————————
D:\mongodb\bin>mongo –host localhost –port 27017
MongoDB shell version: 2.6.4
connecting to: localhost:27017/test
> exit
bye

D:\mongodb\bin>mongo –host localhost –port 27015
MongoDB shell version: 2.6.4
connecting to: localhost:27015/test
2014-09-09T11:25:48.682+0530 warning: Failed to connect to 127.0.0.1:27015, reas
on: errno:10061 No connection could be made because the target machine actively
refused it.
2014-09-09T11:25:48.682+0530 Error: couldn’t connect to server localhost:27015 (
127.0.0.1), connection attempt failed at src/mongo/shell/mongo.js:148
exception: connect failed

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.