1. 为某个数据库创建用户:

use db_test1;

db.createUser({
user:"test_user_1",
pwd:"test_user_1_pwd",
roles:[{role:"dbOwner",db:"test_db_1"}]});

 

2. 在某个数据库中删除用户:
db.dropUser("notaboouser");

 

3. 创建一个集合,查看集合:

db.createCollection("topic")

show collections

相关文章:

  • 2022-01-05
  • 2021-10-18
  • 2021-07-30
猜你喜欢
  • 2021-09-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-30
  • 2021-11-23
相关资源
相似解决方案