連結mongodb伺服器

來源:互聯網
上載者:User

標籤:shu   .exe   image   資料   alt   src   密碼   tar   127.0.0.1   

 

查看mongodb的使用說明

版本是3.6.0

options 選項 指的是使用者名稱和密碼

address 資料庫地址  資料庫格式是 ip:連接埠/資料庫 192.168.0.5:999/foo

連結本機資料庫 test  執行 mongo 127.0.0.1:12345/test

 

表示連結成功  但是有很多警告 許可權問題 因為沒有使用者名稱和密碼

成功的連結了mongodb服務 怎麼關閉呢

使用 db.shutdownServer() 關閉資料庫連結 (我比較喜歡用命令)

發現無法關閉 給出提示 只能使用admin許可權關閉 (net stop mongodb/ net start mongodb)

use admin 

 

 Ctrl+C 退出

查看日誌

使用 tail 命令 tail 命令在windows中藥另行安裝 下載tail.exe

/Files/hantianwei/tail.zip

 下載後解壓,把tail.exe 複製到 目錄:C:\Windows\System32 下

查看日誌 可以看到已經退出

重新啟動mongodb 服務

重新開啟日誌查看 tail -f  c:\data\log\mongod.log

12345 連接埠正在等待連結

 

  Ctrl+C 退出

再次  mongo 127.0.0.1:12345/test 暫時不各種警告

 

連結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.