windows mongodb 添加用户
{
"_id" : "admin.admin123",
"user" : "admin",
"db" : "dbname",
"credentials" : {
"SCRAM-SHA-1" : {
"iterationCount" : 10000,
"salt" : "NHgnBRLj7bYMK9fJGs9v2Q==",
"storedKey" : "cZs/NcqEFD0KbKmCPpckLnXF2gs=",
"serverKey" : "/UZ6/ZHAneNd65KQGlmqcY+ZPa0="
},
"SCRAM-SHA-256" : {
"iterationCount" : 15000,
"salt" : "Torg0mtyHdQ+cFN6QNrq2/h+sYiiN5/2yhayxQ==",
"storedKey" : "H7FUn90dLGC+ubAaIkdq46pFkUQXfzBkqbFNj7WCnWk=",
"serverKey" : "Wnpq2G1nlGxqhVTFycqc0c7H5YSnpQ2GJpvmQL9C8ZI="
}
},
"roles" : [
{
"role" : "readWrite",
"db" : "dbname"
}
]
}
在可视化工具里,把上述json复制插入到要操作库的这个地方
id 里面为账号密码 db为库名