mongodb-win32-i386-3.0.6 使用常见错误

1.Error parsing YAML config file: yaml-cpp: error at line 3, column 28: unknown escape character: m

指定日志文件路径时不要用  ,使用/ 

2.

2015-09-11T15:18:57.982+0800 F CONTROL Failed global initialization: FileNotOpen logpath "D:/applications/mongodb/logs"
should name a file, not a directory.

日志文件必须存在,只有文件夹不可以,不会自动创建文件。

3.

2015-09-11T18:49:32.032+0800 I NETWORK [initandlisten] connection accepted from 127.0.0.1:2621 #3 (1 connection now open)
2015-09-11T18:49:32.048+0800 I ACCESS [conn3] authenticate db: admin { authenticate: 1, nonce: "xxx", user: "admin", key: "xxx" }
2015-09-11T18:49:32.048+0800 I ACCESS [conn3] Failed to authenticate admin@admin with mechanism MONGODB-CR: AuthenticationFailed key mismatch
2015-09-11T18:49:32.048+0800 I NETWORK [conn3] end connection 127.0.0.1:2621 (0 connections now open)

检查密码是否正确,不要包含单引号。假如密码是 !QAZ2wsx  不要-p '!QAZ2wsx'

4. 获取帮助信息

D:applicationsmongodb-win32-i386-3.0.6in>mongo --help
MongoDB shell version: 3.0.6
usage: mongo [options] [db address] [file names (ending in .js)]
db address can be:
  foo                   foo database on local machine
  192.169.0.5/foo       foo database on 192.168.0.5 machine
  192.169.0.5:9999/foo  foo database on 192.168.0.5 machine on port 9999
Options:
  --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
  -h [ --help ]                      show this usage information
  --version                          show version information
  --verbose                          increase verbosity
  --ipv6                             enable IPv6 support (disabled by default)

Authentication Options:
  -u [ --username ] arg              username for authentication
  -p [ --password ] arg              password for authentication
  --authenticationDatabase arg       user source (defaults to dbname)
  --authenticationMechanism arg      authentication mechanism
  --gssapiServiceName arg (=mongodb) Service name to use when authenticating
                                     using GSSAPI/Kerberos
  --gssapiHostName arg               Remote host name to use for purpose of
                                     GSSAPI/Kerberos authentication

file names: a list of files to run. files have to end in .js and will exit after unless --shell is specified
原文地址:https://www.cnblogs.com/zno2/p/4801897.html