MongoDB 连接报错,折磨我一天了

D:mongodbbin>mongo.exe
MongoDB shell version v3.6.0
connecting to: mongodb://127.0.0.1:27017
MongoDB server version: 3.6.0
Server has startup warnings:
2017-12-16T23:50:58.764+0800 I CONTROL [initandlisten]
2017-12-16T23:50:58.764+0800 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database.
2017-12-16T23:50:58.765+0800 I CONTROL [initandlisten] ** Read and write access to data and configuration is
unrestricted.
2017-12-16T23:50:58.766+0800 I CONTROL [initandlisten]
2017-12-16T23:50:58.767+0800 I CONTROL [initandlisten] ** WARNING: This server is bound to localhost.
2017-12-16T23:50:58.768+0800 I CONTROL [initandlisten] ** Remote systems will be unable to connect to this s
erver.
2017-12-16T23:50:58.769+0800 I CONTROL [initandlisten] ** Start the server with --bind_ip <address> to speci
fy which IP
2017-12-16T23:50:58.770+0800 I CONTROL [initandlisten] ** addresses it should serve responses from, or with
--bind_ip_all to
2017-12-16T23:50:58.771+0800 I CONTROL [initandlisten] ** bind to all interfaces. If this behavior is desire
d, start the
2017-12-16T23:50:58.773+0800 I CONTROL [initandlisten] ** server with --bind_ip 127.0.0.1 to disable this wa
rning.
2017-12-16T23:50:58.774+0800 I CONTROL [initandlisten]
2017-12-16T23:50:58.775+0800 I CONTROL [initandlisten]
2017-12-16T23:50:58.775+0800 I CONTROL [initandlisten] ** WARNING: The file system cache of this machine is configure
d to be greater than 40% of the total memory. This can lead to increased memory pressure and poor performance.
2017-12-16T23:50:58.777+0800 I CONTROL [initandlisten] See http://dochub.mongodb.org/cor...
e
2017-12-16T23:50:58.778+0800 I CONTROL [initandlisten]

安了一天没安上,还是报错,求大神,
win7环境

阅读 5.8k
3 个回答

破windows要真是安装不好,就直接重装系统:)

首先这只是警告,不是错误。仔细阅读警告的内容,已经很清楚了。这个实例监听的地址是localhost,远程服务器无法连接到这个实例上(但是你自己从本机应该可以)。你可以通过bindIp来修改监听的地址。比如你的服务器地址是192.168.1.10,那应该在启动时加上--bind_ip "127.0.0.1,192.168.0.10",如果你用配置文件的方式,应该修改bindIp那一段。

其实你已经安装成功了

WARNING1: 创建管理员用户或同时创建额外权限的用户,在启动服务时带 “ --auth ” 参数即可
WARNING2: 绑定IP就好了,如果只是在本机调试就不用理会它了
WARNING3: 似乎只是影响服务器性能,没发现其他影响

一般情况下解决警告1就可正常使用了

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进