MongoDB創(chuàng)建用戶報錯command createUser requires authentication的解決方法
更新時間:2024年09月09日 11:39:32 作者:青春1314
這篇文章主要介紹了MongoDB創(chuàng)建用戶報錯command createUser requires authentication的解決方法,文中通過代碼和圖文講解的非常詳細,對大家的解決問題有一定的幫助,需要的朋友可以參考下
1、執(zhí)行創(chuàng)建用戶報錯如下:

2、解決方法
2.1 關(guān)閉 MongoDB
/usr/local/mongodb/bin/mongod -f /usr/local/mongodb/mongod.conf --shutdown
2.2 修改配置文件
vim /usr/local/mongodb/mongod.conf
將security.authorization值從enabled改為disabled

2.3 啟動MongoDB
/usr/local/mongodb/bin/mongod -f /usr/local/mongodb/mongod.conf
3、驗證
use admin
db.createUser({user:"admin",pwd:"shenz2024",roles:[{role:"root",db:"admin"}]});
以上就是MongoDB創(chuàng)建用戶報錯command createUser requires authentication的解決方法的詳細內(nèi)容,更多關(guān)于MongoDB創(chuàng)建用戶報錯authentication的資料請關(guān)注腳本之家其它相關(guān)文章!
您可能感興趣的文章:
- 解決MongoDB?位置查詢報錯planner?returned?error:?unable?to?find?index?for?$geoNear?query的問題
- 解決MongoDB6.0報錯:"mongo"不是內(nèi)部或外部命令,也不是可運行的程序或批處理文件
- Mongodb啟動報錯完美解決方案:about to fork child process,waiting until server is ready for connections.
- Mongodb 崩潰報錯 Too many open files的問題解析
- MongoDB啟動報錯 28663 Cannot start server
相關(guān)文章
MongoDB 導出導入備份恢復數(shù)據(jù)詳解及實例
這篇文章主要介紹了MongoDB 導出導入備份恢復數(shù)據(jù)詳解及實例的相關(guān)資料,需要的朋友可以參考下2016-10-10
Mac下安裝配置mongodb并創(chuàng)建用戶的方法
最近在在學習nodejs,相比mysql,mongodb與nodejs搭配更合適,存儲數(shù)據(jù)格式也比較接近JS對象。下面這篇文章主要給大家介紹了關(guān)于在Mac下安裝配置mongodb并創(chuàng)建用戶的相關(guān)資料,需要的朋友可以參考下2018-05-05
MongoDB數(shù)據(jù)庫部署環(huán)境準備及使用介紹
這篇文章主要為大家介紹了MongoDB數(shù)據(jù)庫部署環(huán)境準備以及基本的使用介紹,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進步,早日升職加薪2022-03-03

