【发布时间】:2016-12-06 18:26:43
【问题描述】:
我是 MongoDB 新手,我在 64 位窗口中成功安装了 MongoDB。
前几天MongoDB连接成功,但目前没有连接。
MongoDB 安装位置是:-
C:\Program Files\MongoDB\Server\3.2\bin
我已经将此位置放入环境变量中。
然后我创建了目录
C:\Users\Ahmad\data\db
现在我想使用
与 mongoDB 连接C:\Users\Ahmad>mongod --dbpath C:\Users\Ahmad\data\db
然后一些代码正在生成
2016-12-06T12:15:43.735+0530 I CONTROL [initandlisten] MongoDB starting : pid=3
160 port=27017 dbpath=C:\Users\Ahmad\data\db 64-bit host=Shahzad
2016-12-06T12:15:43.736+0530 I CONTROL [initandlisten] targetMinOS: Windows 7/W
indows Server 2008 R2
2016-12-06T12:15:43.736+0530 I CONTROL [initandlisten] db version v3.2.8
2016-12-06T12:15:43.736+0530 I CONTROL [initandlisten] git version: ed70e33130c
977bda0024c125b56d159573dbaf0
2016-12-06T12:15:43.736+0530 I CONTROL [initandlisten] OpenSSL version: OpenSSL
1.0.1p-fips 9 Jul 2015
2016-12-06T12:15:43.737+0530 I CONTROL [initandlisten] allocator: tcmalloc
2016-12-06T12:15:43.737+0530 I CONTROL [initandlisten] modules: none
2016-12-06T12:15:43.737+0530 I CONTROL [initandlisten] build environment:
2016-12-06T12:15:43.737+0530 I CONTROL [initandlisten] distmod: 2008plus-ss
l
2016-12-06T12:15:43.737+0530 I CONTROL [initandlisten] distarch: x86_64
2016-12-06T12:15:43.738+0530 I CONTROL [initandlisten] target_arch: x86_64
2016-12-06T12:15:43.738+0530 I CONTROL [initandlisten] options: { storage: { db
Path: "C:\Users\Ahmad\data\db" } }
2016-12-06T12:15:43.739+0530 I - [initandlisten] Detected data files in C
:\Users\Ahmad\data\db created by the 'wiredTiger' storage engine, so setting the
active storage engine to 'wiredTiger'.
2016-12-06T12:15:43.740+0530 I STORAGE [initandlisten] wiredtiger_open config:
create,cache_size=1G,session_max=20000,eviction=(threads_max=4),config_base=fals
e,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snapp
y),file_manager=(close_idle_time=100000),checkpoint=(wait=60,log_size=2GB),stati
stics_log=(wait=0),
2016-12-06T12:15:44.467+0530 I NETWORK [HostnameCanonicalizationWorker] Startin
g hostname canonicalization worker
2016-12-06T12:15:44.467+0530 I FTDC [initandlisten] Initializing full-time d
iagnostic data capture with directory 'C:/Users/Ahmad/data/db/diagnostic.data'
2016-12-06T12:15:44.473+0530 I NETWORK [initandlisten] waiting for connections
on port 27017
但是连接没有建立,只是等待连接 在端口 27017 消息显示我等待了很长时间,但没有任何反应,
【问题讨论】:
-
你的mongodb服务启动了吗?在 Windows 中,如果手动使用保存 mongodb 数据文件夹的部分,则需要启动
-
它已经成功启动,现在如果你想连接,打开新的终端窗口并执行
mongo命令
标签: angularjs node.js mongodb mean-stack