MongoDB what are the default user and password?

前端 未结 4 1254
傲寒
傲寒 2020-12-22 17:14

I am using the same connection string on local and production. When the connection string is mongodb://localhost/mydb

What is the username and password?

4条回答
  •  渐次进展
    2020-12-22 18:14

    For MongoDB earlier than 2.6, the command to add a root user is addUser (e.g.)

    db.addUser({user:'admin',pwd:'',roles:["root"]})
    

提交回复
热议问题