创建普通用户
#进入MogoDB
mongo
#显示据库
show dbs
#切换到ycsb数据库
use ycsb
#创建用户及密码
db.createUser({ user: "root",pwd: "123", roles: [ { role: "readWrite", db: "ycsb" } ] })
#查看是否存在
db.auth("root","123")
参考:
https://www.jianshu.com/p/79caa1cc49a5
2022-11-11 13:09:22
mongo
show dbs
use ycsb
db.createUser({ user: "root",pwd: "123", roles: [ { role: "readWrite", db: "ycsb" } ] })
db.auth("root","123")
参考:
https://www.jianshu.com/p/79caa1cc49a5
下一篇:125. 验证回文串--双指针