不多说,旧版本使用

db.addUser("root","root")

新版本使用这句会出现这个错误提示

TypeError: db.addUser is not a function : @(shell):1:1

新版本用的是

 db.createUser(
  {
    user: "test",
    pwd: "test",
    roles: [ { role: "userAdmin", db: "test" } ]
  }
)
TypeError: db.addUser is not a function : @(shell):1:1 ——mongoDB创建新用户名密码的方法

 

相关文章:

  • 2022-02-02
  • 2021-07-27
  • 2021-11-29
  • 2021-09-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-08-06
  • 2022-12-23
  • 2022-01-18
  • 2021-05-02
  • 2022-01-08
  • 2021-11-24
  • 2021-09-10
相关资源
相似解决方案