惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

I
Intezer
V
Vulnerabilities – Threatpost
Google Online Security Blog
Google Online Security Blog
T
The Exploit Database - CXSecurity.com
C
CXSECURITY Database RSS Feed - CXSecurity.com
AWS News Blog
AWS News Blog
G
GRAHAM CLULEY
P
Privacy & Cybersecurity Law Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
C
Cybersecurity and Infrastructure Security Agency CISA
N
News | PayPal Newsroom
T
Tenable Blog
Spread Privacy
Spread Privacy
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
S
Secure Thoughts
P
Privacy International News Feed
IT之家
IT之家
Project Zero
Project Zero
T
The Blog of Author Tim Ferriss
Engineering at Meta
Engineering at Meta
大猫的无限游戏
大猫的无限游戏
博客园_首页
GbyAI
GbyAI
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
量子位
雷峰网
雷峰网
Apple Machine Learning Research
Apple Machine Learning Research
Hacker News: Ask HN
Hacker News: Ask HN
Google DeepMind News
Google DeepMind News
MongoDB | Blog
MongoDB | Blog
N
Netflix TechBlog - Medium
Martin Fowler
Martin Fowler
NISL@THU
NISL@THU
I
InfoQ
D
DataBreaches.Net
有赞技术团队
有赞技术团队
K
Kaspersky official blog
Security Latest
Security Latest
The Register - Security
The Register - Security
Hugging Face - Blog
Hugging Face - Blog
S
Security @ Cisco Blogs
P
Proofpoint News Feed
M
MIT News - Artificial intelligence
H
Hackread – Cybersecurity News, Data Breaches, AI and More
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
AI
AI
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
P
Proofpoint News Feed
Security Archives - TechRepublic
Security Archives - TechRepublic
N
News and Events Feed by Topic

博客园 - 阿龍

FW:Software Testing What is the difference between modified duration, effective duration and duration? Netezza External Tables --How to use local files in external table How to push master to QA branch in GIT FTPS Firewall Query performance optimization of Vertica (Forward)5 Public Speaking Tips That'll Prepare You for Any Interview (转)The remote certificate is invalid according to the validation procedure Change - Why we need coding standards (转)测试用例编写规范 (转)测试用例模板(Test Case Template) (转)Facebook如何提高软件质量? 敏捷问题小结 (转)RACI模型(RACI Model) (转)Part 2 - Basic of mocking with Moq (转)MongoDB 增加用户 删除用户 修改用户 读写权限 只读权限, (转)MongoDB设置访问权限、设置用户 赎回收益率(Yield to Call,YTC) YTC, YTM, YTW
(转)MongoDB——安装篇(windows)
阿龍 · 2011-10-29 · via 博客园 - 阿龍

1、下载MongoDB数据库http://fastdl.mongodb.org/win32/mongodb-win32-i386-1.6.5.zip;

2、将安装文件解压到C盘(注意:安装路径中不能出现空格),配置“环境变量”,将 %MONGODB_HOME%\bin 添加到“Path”中;

3、进入DOS窗口,设置数据保存目录(与端口)和日志输出目录。
DOS命令:

Dos代码  收藏代码

  1. mongod --port <端口> --dbpath <数据路径> --logpath <日志路径> --logappend --directoryperdb  
mongod --port <端口> --dbpath <数据路径> --logpath <日志路径> --logappend --directoryperdb

参数说明:
--port    表示数据库端口,默认27017;
--dbpath  表示数据文件存储路径,一般设置为%MONGODB_HOME%\data;
--logpath 表示日志文件存储路径,一般设置为%MONGODB_HOME%\logs\mongodb.log;
--logappend 表示日志追加,默认是覆盖;
--directoryperdb 表示每个db一个目录;

4、完成以上设置,MongoDB已经启动,新开启DOS窗口,执行“mongo.exe”,出现“MongoDB shell version: 1.8.1”表示安装成功了。

5、目前是以无权限限制的方式启动的,你可以做任何操作。那么我们先切换到admin下,创建一个root用户吧。执行命令:
"use admin" -> "db.addUser('root','root')" -> "db.auth('root','root')",如下图所示:

6、把MongoDB注册为Windows Service,让它开机自动启动;执行命令:

Dos代码  收藏代码

  1. mongod --bind_ip 127.0.0.1 --logpath %MONGODB_HOME%\logs\mongodb.log --logappend --dbpath %MONGODB_HOME%\data --directoryperdb --auth --install  
mongod --bind_ip 127.0.0.1 --logpath %MONGODB_HOME%\logs\mongodb.log --logappend --dbpath %MONGODB_HOME%\data --directoryperdb --auth --install

注意:
    a.必须切换到bin目录下执行该条指令。
    b.必须添加--auth用户权限才会生效。
    c.除了“--auth”和“--install”两个参数,别的参数要跟你设置用户时启动服务的参数一致,尤其是“--directoryperdb”。
    第一次配置完成后,一定要重启才会有效果 重启mongo客户端,不输入-u-p可以直接进入,但是不具有任何权限。正确的访问方式为:mongo 数据库名 -u 用户名 -p。另外设置用户

7、服务安装成功后的界面:

8、如果安装失败:
删除MongoDB服务,执行命令:

Dos代码  收藏代码

  1. sc delete MongoDB  
sc delete MongoDB


启动MongoDB服务,执行命令:

Dos代码  收藏代码

  1. net start "MongoDB"  
net start "MongoDB"

9、在cmd下可有两种方法打开,net和sc,net用于打开没有被禁用的服务,语法是:
启动:net/sc start 服务名
停止:net/sc stop 服务名

10、另外,sc可用于打开被禁用的服务,语法是:
sc config 服务名 start= demand    //手动
sc condig 服务名 start= auto      //自动
sc config 服务名 start= disabled //禁用
注意:以上三个命令“=”号后面必须有一个空格

http://hdxiong.iteye.com/blog/1018821