mogodb創建用戶:access control is not enabled for the database

access control is not enabled for the database

出現這個警告的原因是新版本的MongDB爲了讓我們創建一個安全的數據庫 ,
必須要進行驗證 ,
創建管理員:
use admin
db.createUser(
{
user: “userAdmin”, //用戶名
pwd: “123”, //密碼
roles: [ { role: “userAdminAnyDatabase”, db: “admin” } ] //權限
}
)

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章