首页 > MongoDB > mongo登陆选项

mongo登陆选项

来源:原创 作者:thomas 分类:MongoDB 阅读:756 日期:2014-05-26

用法: mongo [options] [db address] [file names (ending in .js)]

db address 可以是:

foo                   本地主机的foo数据库

192.169.0.5/foo       192.168.0.5主机上的foo数据库

192.169.0.5:9999/foo  192.168.0.5主机,端口9999上的foo数据库

选项:

  --shell                                     run the shell after executing files
  --nodb                                      don't connect to mongod on startup - no 'db address' arg expected
  --norc                                      will not run the ".mongorc.js" file on start up
  --quiet                                     be less chatty
  --port arg                                  port to connect to
  --host arg                                  server to connect to
  --eval arg                                  evaluate javascript
  -u [ --username ] arg                       验证用的用户名
  -p [ --password ] arg                       验证用的用户密码
  --authenticationDatabase arg                user source (defaults to dbname)
  --authenticationMechanism arg (=MONGODB-CR) authentication mechanism
  -h [ --help ]                               show this usage information
  --version                                   show version information
  --verbose                                   increase verbosity
  --ipv6                                      enable IPv6 support (disabled by default)
  --ssl                                       use SSL for all connections
  --sslCAFile arg                             Certificate Authority for SSL
  --sslPEMKeyFile arg                         PEM certificate/key file for SSL
  --sslPEMKeyPassword arg                     password for key in PEM file for SSL

file names: a list of files to run. files have to end in .js and will exit after unless --shell is specified
十日谈技术博客


 

热门文章 更多>

微信扫一扫,关注技术十日谈