MongoDB安装(Window环境)

webphp 12年前
     <p style="line-height:19px;margin:5px auto;font-family:verdana,Arial,helvetica,sans-seriff;color:#4b4b4b;">官方下载地址:<a style="color:#6fbc4c;" href="/misc/goto?guid=4958190108423741856">猛击这里</a></p>    <p style="line-height:19px;margin:5px auto;font-family:verdana,Arial,helvetica,sans-seriff;color:#4b4b4b;"><span style="line-height:18px;" id="title-text">Quickstart Windows:<a style="color:#6fbc4c;" href="/misc/goto?guid=4959500785830724241">猛击这里</a></span></p>    <p style="line-height:19px;margin:5px auto;font-family:verdana,Arial,helvetica,sans-seriff;color:#4b4b4b;"> </p>    <p style="line-height:19px;margin:5px auto;font-family:verdana,Arial,helvetica,sans-seriff;color:#4b4b4b;"><span style="line-height:18px;">下载文件解压缩包:</span></p>    <ol style="line-height:19px;font-family:verdana,Arial,helvetica,sans-seriff;color:#4b4b4b;margin-left:2em;">     <li style="list-style-type:decimal;"><span style="line-height:18px;">bsondump.exe</span></li>     <li style="list-style-type:decimal;"><span style="line-height:18px;">mongo.exe</span></li>     <li style="list-style-type:decimal;"><span style="line-height:18px;">mongod.exe</span></li>     <li style="list-style-type:decimal;"><span style="line-height:18px;">mongodump.exe</span></li>     <li style="list-style-type:decimal;"><span style="line-height:18px;">mongoexport.exe</span></li>     <li style="list-style-type:decimal;"><span style="line-height:18px;">mongofiles.exe</span></li>     <li style="list-style-type:decimal;"><span style="line-height:18px;">mongoimport.exe</span></li>     <li style="list-style-type:decimal;"><span style="line-height:18px;">mongorestore.exe</span></li>     <li style="list-style-type:decimal;"><span style="line-height:18px;">mongos.exe</span></li>     <li style="list-style-type:decimal;"><span style="line-height:18px;">mongostat.exe</span></li>    </ol>    <p style="line-height:19px;margin:5px auto;font-family:verdana,Arial,helvetica,sans-seriff;color:#4b4b4b;"><span style="line-height:18px;">在这一刻,我用的版本是1.6.5。在这一刻我不是一个人。</span></p>    <p style="line-height:19px;margin:5px auto;font-family:verdana,Arial,helvetica,sans-seriff;color:#4b4b4b;"><span style="line-height:18px;">严重声明:如果您压缩包中文件与本人不完全一致,请<a style="color:#6fbc4c;" title="鞭挞这里" href="/misc/goto?guid=4958183898586439931">鞭挞这里</a>,找个能留言的地方,质问官方所有工作人员。</span></p>    <p style="line-height:19px;margin:5px auto;font-family:verdana,Arial,helvetica,sans-seriff;color:#4b4b4b;"> </p>    <p style="line-height:19px;margin:5px auto;font-family:verdana,Arial,helvetica,sans-seriff;color:#4b4b4b;"><span style="line-height:18px;">文件都有了,跟着<a style="color:#6fbc4c;" href="/misc/goto?guid=4959500785830724241">Quickstart Windows</a>往下走。不急不躁,MongoDB比Cassandra搭建起来容易的多。</span></p>    <p style="line-height:19px;margin:5px auto;font-family:verdana,Arial,helvetica,sans-seriff;color:#4b4b4b;"><span style="line-height:18px;">继续:</span></p>    <ol style="line-height:19px;font-family:verdana,Arial,helvetica,sans-seriff;color:#4b4b4b;margin-left:2em;">     <li style="list-style-type:decimal;"><span style="line-height:18px;">在C:盘建个文件夹:data</span></li>     <li style="list-style-type:decimal;"><span style="line-height:18px;">在data下再建个文件夹:db</span></li>     <li style="list-style-type:decimal;"><span style="line-height:18px;">最终结果你要有如下目录 C:\data\db</span></li>    </ol>    <p style="margin:5px auto;">继续:</p>    <p style="margin:5px auto;">   上面那10个文件,你放在哪里了?我没提醒你要放在C:\my_mongo_dir里面吗?那,<a style="color:#6fbc4c;" href="/misc/goto?guid=4959500785830724241">Quickstart Windows</a>有吧。</p>    <p style="margin:5px auto;">   猛击:mongod.exe (数据库服务),启动数据库 </p>    <fieldset>     <legend>神秘的屏幕提示</legend>     <p style="margin:5px auto;">C:\MongoDb\mongod.exe --help for help and startup options<br /> Thu Dec 23 16:43:45 MongoDB starting : pid=3928 port=27017 dbpath=/data/db/ 32-b<br /> it</p>     <p style="margin:5px auto;">** NOTE: when using MongoDB 32 bit, you are limited to about 2 gigabytes of data</p>     <p style="margin:5px auto;">**       see <a style="color:#6fbc4c;" href="/misc/goto?guid=4958544461274721902">http://blog.mongodb.org/post/137788967/32-bit-limitations</a></p>     <p style="margin:5px auto;">Thu Dec 23 16:43:45 db version v1.6.5, pdfile version 4.5<br /> Thu Dec 23 16:43:45 git version: 0eb017e9b2828155a67c5612183337b89e12e291<br /> Thu Dec 23 16:43:45 sys info: windows (5, 1, 2600, 2, 'Service Pack 3') BOOST_LI<br /> B_VERSION=1_35<br /> Thu Dec 23 16:43:45 [initandlisten] waiting for connections on port 27017<br /> Thu Dec 23 16:43:45 [websvr] web admin interface listening on port 28017</p>    </fieldset>    <p style="margin:5px auto;">   根据您无语论比的人品,您将看到不尽相同的提示信息。如果神秘提示如彗星般一闪而过,请检查C:\data\db目录您是否已经创建。</p>    <p style="margin:5px auto;">   或者去命令行里面运行mongod.exe吧。提示信息,与你同在。</p>    <p style="margin:5px auto;">   至此,您已经成功完成MongoDB的搭建及启动全过程。</p>    <p style="margin:5px auto;">   不要惊讶,不要怀疑,无需配置文件,没有系统变量,不改动注册表,没有任何安装启动过程,即使弄错了,也不会收到任何友好的,清晰的错误提示。</p>    <p style="margin:5px auto;">   (本想画个圈圈给电视购物栏目,思索再三,做人要厚道。算了。)</p>    <p style="margin:5px auto;"> 提一句:</p>    <ul style="margin:0px 0px 10px 45px;padding-left:5px;font-size:11px;">     <li>关于这个C:\data\db目录,请不要在意,第一遍,就按照默认玩法走一边就好了。不要让旁支细节耽误您前进的脚步与思维。</li>     <li>在cmd的控制台里面启动:mongod -dbpath=D:\myDb。这样就可以指定其他的db存放位置了。</li>    </ul>    <p style="margin:5px auto;"> </p>    <p style="margin:5px auto;">继续:</p>    <p style="margin:5px auto;">   猛击:mongo.exe</p>    <p style="margin:5px auto;"> </p>    <fieldset>     <legend>神秘的屏幕提示2</legend>MongoDB shell version: 1.6.5     <br /> connecting to: test     <br /> >    </fieldset>    <p style="margin:5px auto;"> </p>    <p style="margin:5px auto;">   您无语的人品将再一次名垂青史。(反正经过无数次努力我的是出来了)</p>    <p style="margin:5px auto;">至此,您的第一次MongoDB之旅,宣告完胜。请跟5米范围内的人形生物分享您的喜悦,MongoDB真好用。</p>    <p style="margin:5px auto;"> </p>    <p style="margin:5px auto;">继续:</p>    <p style="margin:5px auto;">  <a style="color:#6fbc4c;" href="/misc/goto?guid=4959500785830724241">Quickstart Windows</a>后面为了印证您是否真的成功启动服务,同时也进一步引诱您使用他们的服务,也保不齐,让您替他们做一次测试,让您在神秘2里面输入如下命令,并看到显示结果:</p>    <p style="margin:5px auto;"> </p>    <fieldset>     <legend>神秘的屏幕提示2</legend>     <p style="margin:5px auto;">MongoDB shell version: 1.6.5<br /> connecting to: test<br /> ></p>     <p style="margin:5px auto;"> > 3+3<br /> 6<br /> > db<br /> test<br /> > <span class="code-comment">// the first write will create the db:<br /> </span>> db.foo.insert( { a : 1 } )<br /> > db.foo.find()<br /> { _id : ..., a : 1 }</p>    </fieldset>