编程小贴士

给你的编程提供小点子


将MongoDB加入到Windows的本地服务项

MongoDB是一款开源的NoSQL数据库,主要应用于数据规模庞大的场合,并被视为Node.js的黄金搭档,由于它采用的是Binary JSON格式,所以与JavaScript具有任何语言都无法媲美的亲和力。关于它的具体介绍本文不作详细阐述,下面主要针对MongoDB在 Windows下加入本地服务项做一些简单的分享。以方便刚接触MongoDB并在Windows环境下进行开发的同学。

首先去官网下载Windows安装包:http://www.mongodb.org/downloads

一般情况下选择默认的64位即可(除非你的主机是32位),下载后,假设我们安装到:D:/soft/mongodb/ ,完成后,进入该目录,新建data和logs两个文件夹,并在logs目录下再新建个mongodb.log。然后打开命令提示符 (CMD),Windows8.1的用户需要用管理员身份打开。执行以下命令

d: && cd /soft/mongodb/bin
回车,再执行:
mongod --dbpath d:/soft/mongodb/data
  1. 1
  2. 2
  3. 3

代码laycode – v1.1

这样MongoDB就愉快地启动了,打开浏览器,进入:http://127.0.0.1:27017,这时你会看到以下提示语:

It looks like you are trying to access MongoDB over HTTP on the native driver port.
翻译:你似乎正在尝试通过HTTP本地服务访问MongoDB
  1. 1
  2. 2
  3. 3

代码laycode – v1.1

好吧,这只是打个酱油。事实上每次通过命令行启动Mongo是痛苦的,因此我们需要建立一个永久性服务,这就需要我们把Mongo加入到Windows本地服务中去。继续回到cmd,执行:

由于我们之前已经进入了d:/soft/mongodb/bin目录,所以只需执行以下命令:
mongod.exe --logpath d:/soft/mongodb/logs/mongodb.log --logappend --dbpath d:/soft/mongodb/data --directoryperdb --serviceName MongoDB -install
  1. 1
  2. 2
  3. 3
  4. 4

代码laycode – v1.1

打开服务窗口,就能看到我们所需要的结果了:

tips1000_2014-08-03_08-49-51

88 Responses to “ 将MongoDB加入到Windows的本地服务项 ”

  1. best pron说道:

    hijnKH Nice! Just wanted to respond. I thoroughly loved your post. Keep up the great work.

  2. Right now it sounds like Movable Type is the top blogging platform out there right now.

  3. painting说道:

    I thought it was going to be some boring old post, but it really compensated for my time. I will publish a link to this page on my weblog. I am sure my visitors will come across that quite useful

  4. Lung Health说道:

    Thanks for sharing, this is a fantastic blog.Thanks Again. Keep writing.

  5. Thank you ever so for you article post.Much thanks again. Fantastic.

  6. read more说道:

    Merely wanna state that this is very helpful , Thanks for taking your time to write this.

  7. Click to read说道:

    This very blog is no doubt interesting and also factual. I have found many handy things out of this amazing blog. I ad love to come back again and again. Thanks a lot!

  8. It as amazing designed for me to have a web site, which is good in support of my knowledge. thanks admin

  9. website说道:

    We hope you will understand our position and look forward to your cooperation.

  10. w88world.com说道:

    wow, awesome blog post.Much thanks again. Really Great.

  11. mca bbb说道:

    Sweet website , super pattern , rattling clean and use friendly.

  12. pretty helpful material, overall I imagine this is really worth a bookmark, thanks

  13. Regards for helping out, wonderful information. Nobody can be exactly like me. Sometimes even I have trouble doing it. by Tallulah Bankhead.

  14. Really enjoyed this blog post.Really thank you! Keep writing.

  15. Many thanks for sharing this first-class write-up. Very interesting ideas! (as always, btw)

  16. cheap taxi说道:

    Perfectly indited content material , Really enjoyed reading.

  17. Simply a smiling visitor here to share the love (:, btw outstanding style and design.

  18. click here说道:

    Very good post. I will be dealing with many of these issues as well..

  19. Wow, amazing blog layout! How long have you been blogging for? you made blogging look easy. The overall look of your website is wonderful, let alone the content!. Thanks For Your article about sex.

  20. Asuquo说道:

    This website really has all the information and facts I wanted concerning this subject and didn at know who to ask.

  21. Nwokolo说道:

    now. (from what I ave read) Is that what you are using

  22. klm coupon code说道:

    Really enjoyed this article.Thanks Again. Want more.

  23. This very blog is definitely cool and diverting. I have chosen many interesting advices out of it. I ad love to come back every once in a while. Thanks a bunch!

  24. You need to participate in a contest for probably the greatest blogs on the web. I all advocate this website!

  25. Drake Mp3说道:

    very good put up, i definitely love this web site, carry on it

  26. tu bep dep说道:

    Major thankies for the article post.Thanks Again. Cool.

  27. Chong tham说道:

    Lately, I did not give a great deal of consideration to leaving comments on blog web page posts and have positioned remarks even considerably much less.

  28. Chong tham说道:

    Very good comments, i really love this site , i am happy to bookmarked and tell it to my friend, thanks for your sharing.

  29. for more details说道:

    What as up, I log on to your blogs on a regular basis. Your humoristic style is awesome, keep up the good work!

  30. visit website说道:

    It is really a nice and useful piece of info. I am happy that you shared this helpful info with us. Please stay us up to date like this. Thank you for sharing.

  31. Thank you ever so for you article.Thanks Again. Awesome.

  32. Your style is so unique in comparison to other folks I ave read stuff from. Thank you for posting when you ave got the opportunity, Guess I all just bookmark this web site.

  33. credits online说道:

    naturally like your web-site however you have to check the spelling

  34. giay nam cong so说道:

    Im obliged for the post.Really looking forward to read more. Keep writing.

  35. themselves, particularly contemplating the truth that you could possibly have carried out it for those who ever decided. The pointers as well served to provide an incredible solution to

  36. I truly appreciate this blog article. Awesome.

  37. Vs model说道:

    That is a very good tip especially to those fresh to the blogosphere. Simple but very precise information Thanks for sharing this one. A must read post!

  38. this website说道:

    You made some clear points there. I did a search on the issue and found most individuals will agree with your website.

  39. David说道:

    lol. So allow me to reword this. Thank YOU for the meal!!

  40. women说道:

    Many thanks for sharing this fine article. Very interesting ideas! (as always, btw)

  41. In my opinion you commit an error. I suggest it to discuss. Write to me in PM, we will talk.

  42. Louvre说道:

    This is one awesome article post.Much thanks again. Much obliged.

  43. visit this site说道:

    Looking forward to reading more. Great article.Really looking forward to read more. Really Great.

  44. Polainas tejidas说道:

    I went over this web site and I believe you have a lot of wonderful information, saved to my bookmarks (:.

  45. pretty handy material, overall I consider this is worthy of a bookmark, thanks

  46. click here说道:

    Thanks for another great post. Where else may anybody get that type of info in such an ideal way of writing? I have a presentation next week, and I am at the search for such information.

  47. Really appreciate you sharing this blog article.Thanks Again. Great.

  48. Waec expo说道:

    placing the other person as website link on your page at appropriate place and other person will also do similar in support of you.

  49. There as definately a great deal to find out about this issue. I like all the points you have made.

  50. This website was how do you say it? Relevant!! Finally I ave found something that helped me. Many thanks!

  51. Pretty! This was a really wonderful article. Thank you for providing these details.

  52. Bdr QQ说道:

    is a trusted QQ Casino poker Online as well as Bandar Ceme Online wagering site that
    supplies on-line card video games such as Online Texas Hold’em,
    DominoQQ, Capsa Online, Ceme Online, Ceme99, Online Gaming Online Poker Sites.
    QQ Online Poker Ceme, the most effective and also most safe on the
    internet casino poker representative site with 24 hour
    IDN Online Texas hold’em solution. For those of you Lovers of
    the game Online Online as well as who wish to play gambling Online
    Texas hold’em, Online Ceme, Domino QQ, City Ceme, Online Gaming,
    Bandar Capsa Online in 1 ID

  53. is a relied on QQ Online poker Online and Bandar Ceme Online gambling site that offers on the internet card video games
    such as Online Online Poker, DominoQQ, Capsa Online, Ceme Online, Ceme99,
    Online Gaming Online Online Poker Sites. QQ Poker Ceme,
    the most effective and safest on the internet casino poker agent website with 1 day
    IDN Online Texas hold’em service. For those of you Lovers of the video
    game Online Online and also that wish to play betting Online Online poker, Online
    Ceme, Domino QQ, City Ceme, Online Betting, Bandar Capsa Online in 1 ID

  54. Very good blog article.Really thank you! Want more.

  55. Very neat article post.Really looking forward to read more. Really Great.

  56. It as awesome for me to have a web site, which is good in favor of my know-how. thanks admin

  57. girl games说道:

    xrumer ??????30????????????????5??????????????? | ????????

  58. to eat. These are superior foodstuff that will assist to cleanse your enamel cleanse.

  59. You ave got a really great layout for the blog i want it to utilize on my web page as well

  60. Many thanks for sharing this good article. Very inspiring! (as always, btw)

  61. Very good information. Lucky me I discovered your site by chance (stumbleupon). I have bookmarked it for later!

  62. go to source说道:

    Outstanding post however , I was wanting to know if you could write a litte more on this subject? I ad be very thankful if you could elaborate a little bit more. Thank you!

  63. you can check说道:

    Simply wanna remark that you have a very nice website , I love the layout it actually stands out.

  64. Wohh exactly what I was looking for, regards for putting up.

  65. Looking forward to reading more. Great article.Much thanks again. Cool. here

  66. for more info说道:

    Looking forward to reading more. Great post.Much thanks again. Will read on…

  67. Way cool! Some very valid points! I appreciate you penning this article and the rest of the site is really good.

  68. Way cool! Some extremely valid points! I appreciate you penning this post plus the rest of the website is extremely good.

  69. It as not that I want to copy your web-site, but I really like the design and style. Could you let me know which theme are you using? Or was it custom made?

  70. Share posts说道:

    I think this is a real great article.Really thank you! Much obliged.

  71. In this article are some uncomplicated ways to jogging a newsletter.

  72. Passion in one as true talent is impressive. Writers today usually have little passion about what they write, but you are a unique and great writer. I am glad to see that writers like you exist.

  73. see this website说道:

    I’а†ve read various exceptional stuff right here. Surely worth bookmarking for revisiting. I surprise how lots try you set to produce this sort of great informative internet site.

  74. Wow, great blog article.Really thank you! Keep writing.

  75. click here说道:

    Thanks for sharing, this is a fantastic blog article.Really looking forward to read more. Really Cool.

  76. Really enjoyed this post.Much thanks again. Much obliged.

  77. Nice blog here! Additionally your website loads up very fast! What web host are you the usage of? Can I get your associate link to your host? I want my website loaded up as fast as yours lol

  78. Agen Joker123说道:

    Muchos Gracias for your blog post. Keep writing.

  79. important site Of course, you are not using some Under-developed place, The united kingdom possesses high water-purification benchmarks

  80. official site说道:

    Looking forward to reading more. Great article.Much thanks again. Really Cool.

  81. more info说道:

    yay google is my king assisted me to find this outstanding website !.

  82. You made some good points there. I checked on the internet for more info about the issue and found most people will go along with your views on this website.

  83. You are my inspiration, I own few web logs and occasionally run out from brand . Truth springs from argument amongst friends. by David Hume.

  84. other details说道:

    Well I sincerely liked studying it. This information offered by you is very helpful for accurate planning.

  85. have a nice day说道:

    Very good article.Really looking forward to read more. Really Cool.

  86. It is actually a great and helpful piece of information. I am happy that you just shared this useful info with us. Please stay us informed like this. Thank you for sharing.

  87. This unique blog is really awesome and also diverting. I have discovered many useful things out of it. I ad love to visit it every once in a while. Thanks a lot!

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>