Mongodb 3.2?????????????
?????wavemelody ???????[ 2016/9/30 11:26:11 ] ??????????? ???ù???
????????
????MongoDBshellversion:3.2.6
????Win7
???????÷???
??????????????
????1??????mongodb??shell??mongo
????2???л??????useadmin
??????3.0?汾????????local?????admin????????????????????
????3???????????????????????????
db.createUser(
{user:"admin"??
customData??{description:"superuser"}??
pwd:"admin"??
roles:[{role:"userAdminAnyDatabase"??db:"admin"}]
}
)
????user??Σ??????????????
????pwd??Σ??????????
????cusomData??Σ??????????????????????????????
????roles??Σ???????????????????????????????????趨????????roles??Σ???????????y????????????????
????4???????????????showusers??db.system.users.find()
????5?????????????
?????????????????????????
????security:
????authorization:enabled
???????????mongodb
????netstopmongodb;
????netstartmongodb;
????6????????????
??????????????????ε??mongoshell?????showdbs??????????“??????”?????????????????????
????db.auth("admin"??"admin")
????????
???????????
????1???????????????read??readWrite;
????2??????????????dbAdmin??dbOwner??userAdmin??
????3?????????????clusterAdmin??clusterManager??clusterMonitor??hostManager??
????4?????????????backup??restore??
????5???????????????readAnyDatabase??readWriteAnyDatabase??userAdminAnyDatabase??dbAdminAnyDatabase
????6??????????????root
????7??//?????м????????????????????????????????dbOwner??userAdmin??userAdminAnyDatabase??
????8??????????__system
??????????????
#??????????????????????
#Mongodconfigfile
#MongoDBconfigurationfilesusetheYAMLformat.
#Thefollowingexampleconfigurationfilecontainsseveralmongodsettings.
#
########ExampleStart########
#systemLog:
#destination:file
#path:"/var/log/mongodb/mongodb.log"
#logAppend:true
#storage:
#journal:
#enabled:true
#processManagement:
#fork:true
#net:
#bindIp:127.0.0.1
#port:27017
#setParameter:
#enableLocalhostAuthBypass:false
#
########ExampleEnd########
#
########CoreOptions
systemLog:
#verbosity:0#Default:0;1to5increasestheverbosityleveltoincludeDebugmessages.
#quiet:<boolean>
#traceAllException:<boolean>
#syslogFacility:user
path:"/usr/local/mongodb/log/mongod.log"
logAppend:true
#logRotate:<string>#renameorreopen
destination:file
#timeStampFormat:iso8601-local
#component:
#accessControl:
#verbosity:0
#command:
#verbosity:0
##COMMENTadditionalcomponentverbositysettingsomittedforbrevity
#storage:
#verbosity:0
#journal:
#verbosity:<int>
#write:
#verbosity:0
#
#
########ProcessManagementOptions
processManagement:
fork:true
pidFilePath:"/usr/local/mongodb/log/mongod.pid"
#
#
#########NetOptions
net:
port:27017
#bindIp:<string>#DefaultAllinterfaces.
#maxIncomingConnections:65536
#wireObjectCheck:true
#ipv6:false
#unixDomainSocket:
#enabled:true
#pathPrefix:"/tmp"
#filePermissions:0700
#http:
#enabled:false
#JSONPEnabled:false
#RESTInterfaceEnabled:false
#ssl:
#sslOnNormalPorts:<boolean>#deprecatedsince2.6
#mode:<string>
#PEMKeyFile:<string>
#PEMKeyPassword:<string>
#clusterFile:<string>
#clusterPassword:<string>
#CAFile:<string>
#CRLFile:<string>
#allowConnectionsWithoutCertificates:<boolean>
#allowInvalidCertificates:<boolean>
#allowInvalidHostnames:false
#FIPSMode:<boolean>
#
#
########securityOptions
#security:
#keyFile:<string>
#clusterAuthMode:keyFile
#authorization:disable
#javascriptEnabled:true
########security.saslOptions
#sasl:
#hostName:<string>
#serviceName:<string>
#saslauthdSocketPath:<string>
#
#
#########setParameterOption
setParameter:
enableLocalhostAuthBypass:false
#<parameter1>:<value1>
#<parameter2>:<value2>
#
#
#########storageOptions
storage:
dbPath:"/data/db"
#indexBuildRetry:true
#repairPath:"/data/db/_tmp"
#journal:
#enabled:true
#directoryPerDB:false
#syncPeriodSecs:60
engine:"mmapv1"#Validoptionsincludemmapv1andwiredTiger.
#########storage.mmapv1Options
#mmapv1:
#preallocDataFiles:true
#nsSize:16
#quota:
#enforced:false
#maxFilesPerDB:8
#smallFiles:false
#journal:
#debugFlags:<int>
#commitIntervalMs:100#100or30
#########storage.wiredTigerOptions
#wiredTiger:
#engineConfig:
#cacheSizeGB:<number>#Default:themaximumofhalfofphysicalRAMor1gigabyte
#statisticsLogDelaySecs:0
#journalCompressor:"snappy"
#directoryForIndexes:false
#collectionConfig:
#blockCompressor:"snappy"
#indexConfig:
#prefixCompression:true
#
#
##########operationProfilingOptions
#operationProfiling:
#slowOpThresholdMs:100
#mode:"off"
#
#
##########replicationOptions
#replication:
#oplogSizeMB:<int>
#replSetName:<string>
#secondaryIndexPrefetch:all
#
#
##########shardingOptions
#sharding:
#clusterRole:<string>#configsvrorshardsvr
#archiveMovedChunks:True
#
#
#########auditLogOptions
#auditLog:
#destination:<string>#syslog/console/file
#format:<string>#JSON/BSON
#path:<string>
#filter:<string>
#
#
#########snmpOptions
#snmp:
#subagent:<boolean>
#master:<boolean>
#
#
########mongos-onlyOptions
#replication:
#localPingThresholdMs:15
#
#sharding:
#autoSplit:true
#configDB:<string>
#chunkSize:64
#
#
########WindowsServiceOptions
#processManagement:
#windowsService:
#serviceName:<string>
#displayName:<string>
#description:<string>
#serviceUser:<string>
#servicePassword:<string>
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11