window上mongodb錯誤:No connection could be made

來源:互聯網
上載者:User

標籤: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中找到瞭解決辦法,如下:



2down vote

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

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.