win7安裝mongodb及命令運(yùn)行教程

--reinstall 是重新安裝,首次安裝沒(méi)有開(kāi)--reset參數(shù),所以用了重裝參數(shù)。
--install 是安裝。
(后來(lái)重啟電腦后,那個(gè)刪不掉的服務(wù)自己消失了)
如果看不懂E文,可以復(fù)制拿去Google翻譯文檔。
E:\mongodb246\bin>mongod.exe -help
Allowed options:</p> <p>General options:
-h [ --help ] show this usage information
--version show version information
-f [ --config ] arg configuration file specifying additional options
-v [ --verbose ] be more verbose (include multiple times for more
verbosity e.g. -vvvvv)
--quiet quieter output
--port arg specify port number - 27017 by default
--bind_ip arg comma separated list of ip addresses to listen on
- all local ips by default
--maxConns arg max number of simultaneous connections - 20000 by
default
--logpath arg log file to send write to instead of stdout - has
to be a file, not directory
--logappend append to logpath instead of over-writing
--pidfilepath arg full path to pidfile (if not set, no pidfile is
created)
--keyFile arg private key for cluster authentication
--setParameter arg Set a configurable parameter
--auth run with security
--cpu periodically show cpu and iowait utilization
--dbpath arg directory for datafiles - defaults to \data\db\
--diaglog arg 0=off 1=W 2=R 3=both 7=W+some reads
--directoryperdb each database will be stored in a separate
directory
--ipv6 enable IPv6 support (disabled by default)
--journal enable journaling
--journalCommitInterval arg how often to group/batch commit (ms)
--journalOptions arg journal diagnostic options
--jsonp allow JSONP access via http (has security
implications)
--noauth run without security
--nohttpinterface disable http interface
--nojournal disable journaling (journaling is on by default
for 64 bit)
--noprealloc disable data file preallocation - will often hurt
performance
--noscripting disable scripting engine
--notablescan do not allow table scans
--nssize arg (=16) .ns file size (in MB) for new databases
--profile arg 0=off 1=slow, 2=all
--quota limits each database to a certain number of files
(8 default)
--quotaFiles arg number of files allowed per db, requires --quota
--repair run repair on all dbs
--repairpath arg root directory for repair files - defaults to
dbpath
--rest turn on simple rest api
--slowms arg (=100) value of slow for profile and console log
--smallfiles use a smaller default file size
--syncdelay arg (=60) seconds between disk syncs (0=never, but not
recommended)
--sysinfo print some diagnostic system information
--upgrade upgrade db if needed
Windows Service Control Manager options:
--install install Windows service
--remove remove Windows service
--reinstall reinstall Windows service (equivalent to --remove
followed by --install)
--serviceName arg Windows service name
--serviceDisplayName arg Windows service display name
--serviceDescription arg Windows service description
--serviceUser arg account for service execution
--servicePassword arg password used to authenticate serviceUser
Replication options:
--oplogSize arg size to use (in MB) for replication op log. default is
5% of disk space (i.e. large is good)
Master/slave options (old; use replica sets instead):
--master master mode
--slave slave mode
--source arg when slave: specify master as <server:port>
--only arg when slave: specify a single database to replicate
--slavedelay arg specify delay (in seconds) to be used when applying
master ops to slave
--autoresync automatically resync if slave data is stale
Replica set options:
--replSet arg arg is <setname>[/<optionalseedhostlist>]
--replIndexPrefetch arg specify index prefetching behavior (if secondary)
[none|_id_only|all]
Sharding options:
--configsvr declare this is a config db of a cluster; default port
27019; default dir /data/configdb
--shardsvr declare this is a shard db of a cluster; default port
27018
安裝好后,瀏覽器運(yùn)行:http://127.0.0.1:28017 打開(kāi)有東西就說(shuō)明裝上了,按理是localhost:端口可上的,不知我電腦是有緩存還是咋的,沒(méi)反應(yīng),換上IP刷新就好了。
打開(kāi)是這么個(gè)界面:

目前著實(shí)沒(méi)看出什么信息,基本正常到此,可能會(huì)被卡住,不知道后續(xù)干什么了。
3:鏈接進(jìn)入命令模式:
正常來(lái)說(shuō),在cmd命令下,運(yùn)行E:\>mongodb246\bin\mongo.exe,(路徑自己弄對(duì))直接就連上了:

之后可以運(yùn)行點(diǎn)命令測(cè)試下,如:
相關(guān)基礎(chǔ)命令可以看:http://docs.mongodb.org/manual/tutorial/getting-started/

再接下來(lái),就是怎么用代碼開(kāi)發(fā)的問(wèn)題了
相關(guān)文章

網(wǎng)絡(luò)工程師必備的6款配置文件編輯神器:替代Notepad++!
本期文章介紹了六種網(wǎng)工必備工具,這些工具是網(wǎng)絡(luò)工程師日常工作中必不可少的,也是那些立志成為網(wǎng)絡(luò)工程師的人應(yīng)該熟悉的2026-04-13
首個(gè)版本v1.111已上線! VS Code開(kāi)啟周更狂飆模式
026年3月10日,微軟宣布將Visual Studio Code(VS Code)更新節(jié)奏從月更提速至周更,并發(fā)布首個(gè)周更版本v1.1112026-03-11
AI直接調(diào)試瀏覽器! VS Code重大更新發(fā)布
還在手動(dòng)打開(kāi)瀏覽器、點(diǎn)擊按鈕、檢查控制臺(tái)報(bào)錯(cuò)?太累了!現(xiàn)在,最新的VS Code 1.110中AI可以直接調(diào)試瀏覽器2026-03-10
vc 6.0代碼是正確編譯無(wú)法運(yùn)行怎么解決?
今天帶大家來(lái)共同學(xué)習(xí)VC++6.0無(wú)法正常運(yùn)行怎么辦?下面就是詳細(xì)完整的操作步驟,快跟小編一起來(lái)學(xué)習(xí)一下2026-02-27
vscode調(diào)試c代碼始終找不到exe可執(zhí)行文件的詳細(xì)及解決辦法
在 VS Code 中調(diào)試 C++ 項(xiàng)目時(shí),常見(jiàn)報(bào)錯(cuò):“無(wú)法啟動(dòng)調(diào)試會(huì)話:找不到可執(zhí)行文件”,這個(gè)問(wèn)題問(wèn)題通常是由于環(huán)境配置不當(dāng)、缺少編譯步驟、路徑設(shè)置錯(cuò)誤、或是launch.json2026-02-27
vscode入門! 小白都能看懂的VS Code保姆級(jí)級(jí)使用教程
相對(duì)于其它前端工具來(lái)說(shuō),VSCode顯得更加的流暢,今天就將我的學(xué)習(xí)經(jīng)歷和大家分享一下,希望可以幫助到有需要的人2026-02-27
2026年真正值得裝、用得上、不雞肋的 VSCode 插件,其實(shí)沒(méi)那么多——挑10個(gè)“神級(jí)”不難,但得是每天打開(kāi)就用、關(guān)掉就難受的那種2026-02-10
VS Code 和 VSCodium怎么選? vscode 和 vscodium之間的區(qū)別
咱們今天就來(lái)聊聊 Visual Studio Code (VS Code) 和 VSCodium的相似與區(qū)別,詳細(xì)請(qǐng)看下文介紹2026-01-10
如何啟用.NET Framework3.5? 一鍵安裝net3.5解決軟件依賴問(wèn)題
你是否曾在安裝某些軟件時(shí)遇到過(guò)“需要.NET Framework 3.5”的提示?實(shí),只需要幾步簡(jiǎn)單的操作,你就可以輕松解決這個(gè)問(wèn)題2025-10-28
VS Code中Java擴(kuò)展代碼重構(gòu)功能的使用詳解
在軟件開(kāi)發(fā)過(guò)程中,重構(gòu)是一個(gè)非常重要的環(huán)節(jié),重構(gòu)可以提高代碼的可讀性、可維護(hù)性和可擴(kuò)展性,使代碼更加健壯和易于理解,本文將介紹如何使用 VSCode 進(jìn)行 Java 代碼重構(gòu)2025-09-20





