search

Home  >  Q&A  >  body text

mongodb 的 local 库怎么做用户验证

如题。 local 是不能添加用户的,如果在 shell 可以在 admin 下完成验证再切到 local 库。在应用里应该怎么写呢?

巴扎黑巴扎黑2757 days ago613

reply all(1)I'll reply

  • PHP中文网

    PHP中文网2017-05-02 09:21:48

    I don’t know what language you are using, but currently the drivers of various languages ​​support database switching, which means that the database separation of authentication and operation can be achieved. You can select admin for authentication when connecting to the database, and then switch to the local database for operations after connecting. Note, make sure that your user in the admin has permission to operate the local database!

    reply
    0
  • Cancelreply