[root@st01 ~]# tar -zxf mongodb-3.6.13.tar.gz -C /export/server/
mongodb-3.6.13
mongos> use admin;
switched to db admin
db.createUser({user:"root",pwd:"jd123!",roles:[{role:"root",db:"admin"}]})
mongos> use jd
switched to db jd
db.createUser({user:"jiangzz",pwd:"jd123!",roles:[{role:"readWrite",db:"mydb1"}]})=----------------------------------------------------
mongos> use admin;
switched to db admin
db.createUser({user:"root",pwd:"jd123!",roles:[{role:"root",db:"admin"}]})
mongos> use jd
switched to db jd
db.createUser({user:"jiangzz",pwd:"jd123!",roles:[{role:"readWrite",db:"mydb1"}]})