为mongodb添加账号
2023-02-18 16:41:32 时间
- 进入切换到某一个数据库,我这里是位每个模块分配一个DataBase
use 0
- 执行添加账号命令
db.createUser( { user: "*****", pwd: "*****", roles: [{role: "readWrite", db: "peper_test"}] } )
-
具体参数参见官方文档 https://docs.mongodb.com/manual/reference/system-roles-collection/
相关文章
- [Linux] ubuntu系统多PHP版本切换
- [git] 查看两个分支的差异
- [git] git清理远端已删除分支在本地的备份
- [git] Git Clean 清除 untrack 没有加入版本库的文件
- [linux] ab压测工具进行post压力测试
- [Go]golang中的urlencode和urldecode
- [linux] du查找数据大的目录
- [Go] golang获取程序执行的绝对路径
- [linux] 查看centos或ubuntu的系统版本
- [linux] centos系统yum安装rz与sz
- [GO]golang实现AES加解密
- [GO] 解决:crypto/aes: invalid key size 14
- [git] git拉取远程分支代码
- [gitlab] 解决:remote: Ask a project Owner or Maintainer to create a default branch:
- [linux]查看文件目录是否为硬链接
- [go] 解决:concurrent write to websocket connection
- [git] log中Merge branch 'master' of xxx的产生原因
- [Linux] nacos配置中心curl发布和获取服务以及配置
- [linux] Windows 10 家庭版安装wsl ubuntu子系统
- [GIT] git打标签tag和分支branch的区别