今天在慕课网(很不错的一个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.
...
在http://stackoverflow.com/questions/23726684/mongodb-on-a-windows-7-machine-no-connection-could-be-made中找到了解决办法,如下: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
2
|
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. |