Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Web Technology by (50.2k points)

I've installed MongoDB and I am getting stuck with the following errors:

When I execute "mongo" I get logged into the shell

When I execute "mongodb" I get the following errors:

 2016-06-23T22:58:39.302+0000 I CONTROL  [initandlisten] MongoDB starting : pid=7221 port=27017 dbpath=/data/db 64-bit host=debian

 2016-06-23T22:58:39.302+0000 I CONTROL  [initandlisten] db version v3.2.7

 2016-06-23T22:58:39.302+0000 I CONTROL  [initandlisten] git version: 

 4249c1d2b5999ebbf1fdf3bc0e0e3b3ff5c0aaf2

 2016-06-23T22:58:39.302+0000 I CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.0.1t  3 May 2016

 2016-06-23T22:58:39.302+0000 I CONTROL  [initandlisten] allocator: tcmalloc

 2016-06-23T22:58:39.302+0000 I CONTROL  [initandlisten] modules: none

 2016-06-23T22:58:39.302+0000 I CONTROL  [initandlisten] build environment:

 2016-06-23T22:58:39.302+0000 I CONTROL  [initandlisten] distmod: debian71

 2016-06-23T22:58:39.303+0000 I CONTROL  [initandlisten] distarch: x86_64

 2016-06-23T22:58:39.303+0000 I CONTROL  [initandlisten] target_arch: x86_64

 2016-06-23T22:58:39.303+0000 I CONTROL  [initandlisten] options: {}

 2016-06-23T22:58:39.325+0000 E NETWORK  [initandlisten] listen(): bind() failed errno:98 Address already in use for socket: 0.0.0.0:27017

 2016-06-23T22:58:39.325+0000 E NETWORK  [initandlisten] addr already in use

 2016-06-23T22:58:39.325+0000 E STORAGE  [initandlisten] Failed to set up sockets during startup.

 2016-06-23T22:58:39.325+0000 I CONTROL  [initandlisten] dbexit: rc: 48

Can someone suggest that what is the difference between two terminal commands: mongo as a first, and mongodb as a second?

I am using MongoDB because it is great for my project as it is schema-less.

Thanks in advance.

1 Answer

0 votes
by (108k points)

For connecting to the mongodb server, you have to first get connected to the localhost 27017. So for connecting to the localhost, we will first run the mongod exe file. It is the deamon of mongodb which handles all the data requests and manages the access of the data and performs the background management operations. Then after connecting to the mongo server then we will run the mongo exe file for performing various operations in MongoDB

If you want to learn more about MongoDB then go through this MongoDB course for more insights.

Related questions

0 votes
2 answers
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked Mar 15, 2020 in Web Technology by ashely (50.2k points)

Browse Categories

...