码迷,mamicode.com
首页 > 数据库 > 详细

window上mongodb错误:No connection could be made

时间:2014-12-11 12:21:26      阅读:232      评论:0      收藏:0      [点我收藏+]

标签:exception   数据库   command   windows   

今天在慕课网(很不错的一个IT技术免费网站)上学习nodeJS开发电影网站,其中使用到了mongo数据库,但是在执行中遇到了如下错误!

Failed to connect to 127.0.0.1:27017, reason: errno:10061 No connection could be made because the target machine actively refused it.

...

Error: couldn‘t connect to server 127.0.0.1:27017 (127.0.0.1), connection attempt failed at src/mongo/shell/mongo.js:146 exception: connect failed

在http://stackoverflow.com/questions/23726684/mongodb-on-a-windows-7-machine-no-connection-could-be-made中找到了解决办法,如下:



I got same error and fixed it by:

1) mkdir c:\data

2) cd data

3) mongod -dbpath .

4) Now in another command window i was able to connect from my client using "mongo" command.

试了一下,使用两个命令行,一个用于接收连接,一个用于发送连接。问题是解决了,但是还是没发现问题的本质原因,如有知道了,请给我留言,谢谢各位。


window上mongodb错误:No connection could be made

标签:exception   数据库   command   windows   

原文地址:http://blog.csdn.net/xiebaochun/article/details/41864347

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!