Thứ Hai, 15 tháng 1, 2018

Create User Mongodb

1. Connect to MongoDB
mongo --port 27017 -u siteUserAdmin -p password --authenticationDatabase admin
2. Create the new user.
use reporting
db.createUser(
    {
      user: "reportsUser",
      pwd: "12345678",
      roles: [
         { role: "read", db: "reporting" },
         { role: "read", db: "products" },
         { role: "read", db: "sales" },
         { role: "readWrite", db: "accounts" }
      ]
    }
)

Share This!


Không có nhận xét nào:

Đăng nhận xét