日期:2014-05-16  浏览次数:20526 次

鍒濆MongoDB---瀹夎

聽聽聽 浠婂ぉ鍒氬紑瀛︽帴瑙︿簡NoSql鏁版嵁搴揗ongoDB,鐢ㄨ捣鏉ユ劅瑙変笉閿欙紝璁板綍涓嬪畨瑁呯殑涓€浜涗簨銆?/p>

聽聽聽 1銆佸畼缃戜笅杞絯indows鐗?4浣嶇殑鍘嬬缉鍖咃紝鐒跺悗瑙e帇鍒颁竴涓枃浠跺す鍗冲彲锛岃矾寰勪笉瑕佸甫绌烘牸涔嬬被鐨勩€?D:\mongo)

聽聽聽聽2銆佹妸D:\mongo\bin鐩綍鍔犲叆鐜鍙橀噺Path銆偮犅犅?/p>

聽聽聽 3銆佸湪浠绘剰浣嶇疆鍒涘缓涓€涓暟鎹簱鏂囦欢澶广€?D:\mongo\db)

聽聽聽 4銆佸惎鍔∕ongoDB鏈嶅姟:mongod --dbpath D:\mongo\db,浼氳嚜鍔ㄥ湪db鐩綍涓嬪垱寤篗ongDB鐩稿叧鏂囦欢

聽聽聽 5銆佸湪Cmd涓繍琛宮ongo鍛戒护杩涘叆鏁版嵁搴撶郴缁?鏃犳剰澶栬〃绀哄畨瑁呮垚鍔熴€?/span>

聽聽聽

聽聽聽聽鎶奙ongoDB鍋氭垚涓€椤箇indows鏈嶅姟鍚姩

聽聽聽聽鍥犱负姣忔鍚姩mongodb鏈嶅姟閮借鍦–md鐨勪腑杈撳叆 mongod --dbpath D:\mongo\db,杩欐槸闈炲父涓嶇埥鐨?鎵€浠?/span>

聽聽聽 灏哅ongoDB鏈嶅姟娉ㄥ唽鍒皐indows鏈嶅姟涓€?/span>

聽聽聽 1銆佸垱寤轰竴涓瓨鏀緈ongodb鐨勬棩蹇楃殑鏂囦欢澶癸紝蹇呴』鐨勩€?D:\mongo\log)

聽聽聽聽2銆佷娇鐢ㄥ懡浠よ繘琛屽畨瑁?mongod --logpath D:\mongo\log\mongodb.log --logappend --dbpath D:\mongo\db --directoryperdb --serviceName mongodb --install

聽聽聽 3銆佹棤鎰忓鍙戠敓灏辫〃绀哄畨瑁呮垚鍔熴€?/span>

聽聽聽 PS:

聽聽聽 1銆乴og涓嬬殑mongodb.log 浼氳嚜鍔ㄥ垱寤猴紝logpath涓€瀹氳鎸囧畾涓€涓叿浣撶殑鏂囦欢锛屾棩蹇楁槸浠ヨ拷鍔犵殑鏂瑰紡杈撳嚭鐨勩€?/span>

聽聽聽 2銆乨irectoryperdb 璇存槑姣忎釜DB閮戒細鏂板缓涓€涓洰褰曘€?/span>

聽聽聽 3銆乻erviceName 璇存槑鐨勬槸windows鏈嶅姟鐨勫悕绉般€?浠ヤ笂涓変釜鑷畾)

聽聽聽 4銆乮nstall聽 琛ㄧず瀹夎 , 閭e嵏杞芥湇鍔″氨鏄痳emove銆?/span>

聽聽聽聽 鎺ヤ笅鏉ュ紑鍚?鍏抽棴mongodb鏈嶅姟灏卞緢绠€鍗曚簡銆?/span>

聽聽聽聽 1銆佸紑鍚?net start mongodb

聽聽聽聽聽2銆佸叧闂?net stop mongodb

聽聽聽聽 3銆佸垹闄B聽聽sc delete mongodb