[root@localhost]# mongo
MongoDB shell version: 2.4.6
connecting to: tank
> use admin //切换到admin数据库
switched to db admin
> show collections;
system.indexes
system.users //用户表
> db.system.users.find(); //用户表没有数据
> db.addUser('tank','test'); //添加一个管理员账号
{
"user" : "tank",
"readOnly" : false,
"pwd" : "988432606980d0695e4f668f6bbc643a",
"_id" : ObjectId("529e5d543b6a4608ac833429")
}
标签: version,管理员,数据库