mongodb錯誤解決方案

來源:互聯網
上載者:User

標籤:基本   tps   一個   1.3   描述   今天   ODB   一段   code   

問題描述:

因為一段時間沒有使用MongoDB資料庫,所以今天出現一個問題,在進入MongoDB資料庫後執行show dbs等命令基本都會出現一個錯誤,如下:

MongoDB Enterprise > show dbs;
2018-05-19T12:05:01.313+0800 E QUERY [thread1] Error: listDatabases failed:{
"ok" : 0,
"errmsg" : "not authorized on admin to execute command { listDatabases: 1.0, $db: \"admin\" }",
"code" : 13,
"codeName" : "Unauthorized"
} :
[email protected]/mongo/shell/utils.js:25:13
[email protected]/mongo/shell/mongo.js:65:1
[email protected]/mongo/shell/utils.js:820:19
[email protected]/mongo/shell/utils.js:710:15
@(shellhelp2):1:1

我到現在也不知道具體錯在哪裡,看錯誤像許可權問題,但按照網上的一些許可權方法解決,沒有用。

最後,我的MongoDB安裝步驟是按照百度https://jingyan.baidu.com/article/d5c4b52bef7268da560dc5f8.html裝的,我就把其中的data資料和log資料刪除,重建立立新的檔案,再將服務重新安裝。前提是你必須把資料庫先關閉。這樣就解決了。

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.