To connect to the mongo, we must first start the mongod services. You can see the following result:
$ mongod 2017-03-05T00:31:39.055+0530 I CONTROL [initandlisten] MongoDB starting : pid=1481 port=27017 dbpath=/data/db 64-bit host=Prabhu-Nandans-Mac.local 2017-03-05T00:31:39.056+0530 I CONTROL [initandlisten] db version v3.4.2 2017-03-05T00:31:39.056+0530 I CONTROL [initandlisten] git version: 3f76e40c105fc223b3e5aac3e20dcd026b83b38b 2017-03-05T00:31:39.056+0530 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.2k 26 Jan 2017 2017-03-05T00:31:39.056+0530 I CONTROL [initandlisten] allocator: system 2017-03-05T00:31:39.056+0530 I CONTROL [initandlisten] modules: none 2017-03-05T00:31:39.056+0530 I CONTROL [initandlisten] build environment: 2017-03-05T00:31:39.056+0530 I CONTROL [initandlisten] distarch: x86_64 2017-03-05T00:31:39.056+0530 I CONTROL [initandlisten] target_arch: x86_64 2017-03-05T00:31:39.056+0530 I CONTROL [initandlisten] options: {} 2017-03-05T00:31:39.056+0530 W - [initandlisten] Detected unclean shutdown - /data/db/mongod.lock is not empty. 2017-03-05T00:31:39.057+0530 I - [initandlisten] Detected data files in /data/db created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'. 2017-03-05T00:31:39.057+0530 W STORAGE [initandlisten] Recovering data from the last clean checkpoint. 2017-03-05T00:31:39.057+0530 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=3584M,session_max=20000,eviction=(threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),checkpoint=(wait=60,log_size=2GB),statistics_log=(wait=0), 2017-03-05T00:31:39.620+0530 I CONTROL [initandlisten] 2017-03-05T00:31:39.620+0530 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database. 2017-03-05T00:31:39.620+0530 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted. 2017-03-05T00:31:39.620+0530 I CONTROL [initandlisten] 2017-03-05T00:31:39.620+0530 I CONTROL [initandlisten] 2017-03-05T00:31:39.620+0530 I CONTROL [initandlisten] ** WARNING: soft rlimits too low. Number of files is 256, should be at least 1000 2017-03-05T00:31:39.643+0530 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory '/data/db/diagnostic.data' 2017-03-05T00:31:39.643+0530 I NETWORK [thread1] waiting for connections on port 27017 2017-03-05T00:31:40.008+0530 I FTDC [ftdc] Unclean full-time diagnostic data capture shutdown detected, found interim file, some metrics may have been lost. OK 2017-03-05T00:32:03.832+0530 I NETWORK [thread1] connection accepted from 127.0.0.1:49806
After that, open another terminal and just enter "mongo".
After the output, you can see:
$ mongo MongoDB shell version v3.4.2 connecting to: mongodb:
Your problem has been resolved :)
Prabhu Nandan Kumar Mar 04 '17 at 19:20 2017-03-04 19:20
source share