首页 > 代码库 > 数据库授权,创建用户等

数据库授权,创建用户等

mongod --auth --logpath "D:\Program Files (x86)\Web\mongodb\log\log.log" --logappend --dbpath "D:\Program Files (x86)\Web\mongodb\data\db" --directoryperdb --reinstall


db.createUser( { user: "maclean", pwd: "maclean", roles: [ { role: "__system", db: "admin" } ] } )


grant all privileges on *.* to joe@localhost identified by ’1’

数据库授权,创建用户等