Windows上安裝MongoDB步驟

來源:互聯網
上載者:User

標籤:ice   資料庫   添加   http   log   瀏覽器   download   mon   右鍵   

1.在mongoDB官網下載.msi檔案,我下的是社區版,:https://www.mongodb.com/download-center#community

2.點擊msi檔案安裝mongoDB,預設安裝在C:\Program Files\MongoDB\Server\3.2

3.添加安裝路徑到環境變數,也就是把C:\Program Files\MongoDB\Server\3.2\bin添加到環境變數裡面。關於環境變數:右鍵點擊電腦,選擇屬性,點擊系統進階設定,點擊進階裡面的環境變數,找到變數名為Path的一行點擊編輯,將C:\Program Files\MongoDB\Server\3.2\bin添加到最後,記得跟前面的要用分號隔開

4.建立mongoDB的資料和log檔案夾。比如在D盤建立檔案夾mongoDB,在其下分別建立子檔案夾data和log。

5.cmd開啟命令提示字元視窗,輸入mongod --dbpath "D:\mongoDB\data" --logpath "D:\mongoDB\log\mongo.log" --install --serviceName "mongoDB",斷行符號

6.net start mongDB,會提示mongoDB服務已經啟動成功,預設監聽的TCP連接埠是27017,可以在瀏覽器地址欄輸入localhost:27017,會看到出現:

It looks like you are trying to access MongoDB over HTTP on the native driver port.

7.使用mongo命令進入mongo shell進行資料庫的操作

Windows上安裝MongoDB步驟

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.