标签:
use mydb
db.createUser( { "user" : "sa",
"pwd": "sa",
"customData" : { employeeId: 12345 },
"roles" : [ { role: "clusterAdmin", db: "admin" },
{ role: "readAnyDatabase", db: "admin" },
"readWrite"
] },
{ w: "majority" , wtimeout: 5000 } )
mongo -u sa -p sa --authenticationDatabase mydb
标签:
原文地址:http://www.cnblogs.com/byxxw/p/4688307.html