首页 > 数据库 >mongo_db数据库

mongo_db数据库

时间:2023-10-16 12:45:51浏览次数:20  
标签:use mongo -- 数据库 db user

数据库数据服务器下,每次创建一个数据库。user database_name;("没有就会创建---有的话就会切换")

并且 每个数据库下面又单独的用户。

 

1--:创建用户:

先use到指定的数据库。

db.createUser(
{
   user: "ems",
   pwd:  "Rxd123456!",   // or cleartext password
  roles: [ { role: "readWrite", db: "ems" }]
  }
)

2--:查看用户

use admin
db.system.users.find()

 

标签:use,mongo,--,数据库,db,user
From: https://www.cnblogs.com/liuliu-hai/p/17767102.html

相关文章

  • 【gdb】同时调试父进程和子进程
    同时调试父进程和子进程1.   参考资料1.gdb手册2.同时调试父进程和子进程......
  • electron 本地数据库sqlite
    背景某些不会频繁变动,但是数据量可能比较大,查询也比较频繁地数据,例如通讯录等。如果每次都查询服务器的数据库可能造成服务器压力过大,考虑在本地做数据库存储,有更新时从服务器同步数据到本地数据库,用户操作查询则使用本地数据库查询。方案进入页面时(或者其他适当时机)请求服务......
  • Qt/C++编写物联网组件/支持modbus/rtu/tcp/udp/websocket/mqtt/多线程采集
    一、功能特点支持多种协议,包括Modbus_Rtu_Com/Modbus_Rtu_Tcp/Modbus_Rtu_Udp/Modbus_Rtu_Web/Modbus_Tcp/Modbus_Udp/Modbus_Web等,其中web指websocket。支持多种采集通讯方式,包括串口和网络等,可自由拓展其他方式。自定义采集间隔(精确到毫秒)和超时次数,超时后自动将离线的文件......
  • 常用JDBC数据库驱动包和类名
    MySQL数据库:  1)驱动包:https://mvnrepository.com/artifact/mysql/mysql-connector-java(下载路径)  2)驱动类名:com.mysql.jdbc.Driver  3)JDBC的URL:jdbc:mysql://IP地址:端口号/数据库名字   注:端口号缺省为:3306    SQLserver数据库:  1)驱动包:https......
  • 【gdb】设置读观察点
    设置读观察点1.例子#include<stdio.h>#include<pthread.h>#include<unistd.h>inta=0;void*thread1_func(void*p_arg){while(1){a++;sleep(10);}}void*thread2_func(void*p_arg){while(1){a++;sleep(10......
  • 【gdb】设置读写观察点
    设置读写观察点1.例子:#include<stdio.h>#include<pthread.h>#include<unistd.h>inta=0;void*thread1_func(void*p_arg){while(1){a++;sleep(10);}}void*thread2_func(void*p_arg){while(1){a++;sleep(1......
  • 轻松掌握组件启动之MongoDB(上):高可用复制集架构环境搭建
    MongoDB复制集复制集架构在生产环境中,强烈不建议使用单机版的MongoDB服务器。原因如下:单机版的MongoDB无法保证系统的可靠性。一旦进程发生故障或是服务器宕机,业务将直接不可用。此外,一旦服务器上的磁盘损坏,数据会直接丢失,而此时并没有任何副本可用。为了确保数据的高可用性和......
  • 【gdb】
      #include<stdio.h>#include<pthread.h>#include<unistd.h>inta=0;void*thread1_func(void*p_arg){while(1){a++;sleep(10);}}void*thread2_func(void*p_arg){while(1){a++;sleep(10);}}......
  • 【gdb】输出信息多时不会暂停输出
    输出信息多时不会暂停输出有时当gdb输出信息较多时,gdb会暂停输出,并会打印“---Type<return>tocontinue,orq<return>toquit---”这样的提示信息,如下面所示:81process26391020xff04af84in__lwp_park()from/usr/lib/libc.so.180process25735660xff04......
  • 【gdb】设置观察点
    设置观察点1.例子#include<stdio.h>#include<pthread.h>#include<unistd.h>inta=0;void*thread1_func(void*p_arg){ while(1) { a++; sleep(10); }}intmain(intargc,char*argv[]){ pthread_tt1; pthread_create(&t1,NUL......