我刚在Windows 10上安装了mongodb。
$ mongod --auth --dbpath ./db/
2017-04-26T15:08:27.905+0800 I CONTROL [initandlisten] MongoDB starting : pid=244 port=27017 dbpath=./db 64-bit host=DESKTOP-NK0JQ4S
2017-04-26T15:08:27.906+0800 I CONTROL [initandlisten] targetMinOS: Windows 7/Windows Server 2008 R2
2017-04-26T15:08:27.907+0800 I CONTROL [initandlisten] db version v3.4.4
2017-04-26T15:08:27.907+0800 I CONTROL [initandlisten] git version: 888390515874a9debd1b6c5d36559ca86b44babd
2017-04-26T15:08:27.907+0800 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.1u-fips 22 Sep 2016
2017-04-26T15:08:27.908+0800 I CONTROL [initandlisten] allocator: tcmalloc
2017-04-26T15:08:27.908+0800 I CONTROL [initandlisten] modules: none
2017-04-26T15:08:27.909+0800 I CONTROL [initandlisten] build environment:
2017-04-26T15:08:27.909+0800 I CONTROL [initandlisten] distmod: 2008plus-ssl
2017-04-26T15:08:27.909+0800 I CONTROL [initandlisten] distarch: x86_64
2017-04-26T15:08:27.909+0800 I CONTROL [initandlisten] target_arch: x86_64
2017-04-26T15:08:27.910+0800 I CONTROL [initandlisten] options: { security: { authorization: "enabled" }, storage: { dbPath: "./db/" } }
2017-04-26T15:08:27.914+0800 I - [initandlisten] Detected data files in ./db created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
2017-04-26T15:08:27.915+0800 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=3525M,session_max=20000,eviction=(threads_min=4,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-04-26T15:08:28.795+0800 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory './db/diagnostic.data'
2017-04-26T15:08:28.798+0800 I NETWORK [thread1] waiting for connections on port 27017
2017-04-26T15:08:34.860+0800 I NETWORK [thread1] connection accepted from 127.0.0.1:59658 #1 (1 connection now open)
$ mongo
MongoDB shell version v3.4.4
connecting to: mongodb://127.0.0.1:27017
这只是表明它连接到MongoDB,但无法连接到MongoDB服务器。