`
leonzhx
  • 浏览: 786305 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

Setup MongoDB

 
阅读更多

1.  MongoDB is self-contained and does not have any other system dependencies. You can run MongoDB from any folder you choose. You may install MongoDB in any directory.

2.  MongoDB requires a data folder to store its files. The default location for the MongoDB data directory is C:\data\db . You may specify an alternate path with the dbpath setting for mongod.ext:
C:\mongodb\bin\mongod.exe --dbpath d:\test\mongodb\data

3.  To start MongoDB, execute bin\mongod.exe . Do not make mongod.exe accessible to public networks without running in “Secure Mode” on a public network. Usually, MongoDB runs in “trusted environments” and the database does not enable authentication or “Secure Mode” by default.

4.  To connect to MongoDB using the bin\mongo.exe . This mongo shell will connect to the database running on the localhost interface and port 27017 by default. And the mongoDB by default has a “test ” database.

5.  You can pass mongo an optional argument specifying the address, port and even the database to initially connect to:  

./mongo foo #connects to the foo database on your local machine
./mongo 192.168.13.7/foo #connects to the foo database on 192.168.13.7
./mongo dbserver.mydomain.com/foo #connects to the foo database on dbserver.mydomain.com
./mongo 192.168.13.7:9999/foo #connects to the foo database on 192.168.13.7 on port 9999
 


6.  When the shell is launched, it checks the user's home directory for a javascript file named mongorc.js . If this file is found, its contents are interpreted and run by the shell prior to displaying the prompt for the first time. This allows the user to define variables, customize the prompt, or update information that they would like updated every time they launch a shell. This functionality can be overridden with the --norc flag. It should be noted that if a file is specified to be executed by the shell, the rc file will not be run until after that file has completed.

 

7.  You should set up a configuration file when running MongoDB as a Windows Service:
echo logpath=C:\mongodb\log > C:\mongodb\mongod.cfg

Consider setting the logappend option, otherwise, mongod.exe will delete the contents of the existing log file when starting. To install the MongoDB service:
C:\mongodb\bin\mongod.exe --config C:\mongodb\mongod.cfg --install

For the --install option to succeed, you must specify a logpath setting or the --logpath run-time option. To remove MongoDB Service:
C:\mongodb\bin\mongod.exe --remove

分享到:
评论

相关推荐

    delphi所有笔记,还有mongodb innosetup sql等

    总结来说,这些笔记涵盖了从客户端应用程序开发(Delphi)、数据库管理(MongoDB)、安装部署(InnoSetup)到数据管理(SQL)的广泛知识,对于希望全面理解软件开发流程的开发者来说是非常宝贵的资源。通过深入学习...

    setup-mongodb:MongoDB 缺失的操作

    - uses : ankane/setup-mongodb@v1 版本 指定版本(默认为最新) steps : - uses : ankane/setup-mongodb@v1 with : mongodb-version : 4.4 目前支持 版本 4.4 4.2 4.0 3.6 3.4 3.2 ubuntu-20.04 ✓ ...

    robotframework-mongodblibrary:MongoDB的关键字库

    机器人框架-MongoDB库 Robot Framework MongoDB库是用于使用Robotframework测试MongoDB应用程序的库。...Test Setup Setup MongoDB *** Test Cases *** should insert given document Insert Document myCollection {s

    Windows上安装MongoDB:完整步骤详解.pdf

    2. 选择安装类型:在“Choose Setup Type”界面,选择“Complete”以安装全部组件,确保包含MongoDB服务器和MongoDB Compass(一个图形用户界面工具,用于管理数据库)。 3. 设置服务用户:在“Service ...

    python2.7导入shp文件到mongodb

    - 运行 `setup.py` 文件,例如 `python setup.py install`,将Progressbar安装到Python的 `Lib` 目录下。 #### 导入.shp数据到MongoDB 接下来我们将使用Python脚本来完成.shp数据的导入。 ```python #coding:utf-8...

    PyPI 官网下载 | mongodbshell-0.1a4.tar.gz

    从压缩包子文件的文件名称列表`mongodbshell-0.1a4`来看,解压后可能包含源代码、文档、测试文件等,例如`setup.py`用于构建和安装,`README`文件提供项目简介,`requirements.txt`列出依赖的Python库,以及可能的`...

    python insert-mongodb库源代码

    在这个库中,`setup.py`可能包含了`insert-mongodb`库的依赖,如`pymongo`,这是Python连接MongoDB的官方驱动。安装库时,Python会读取`setup.py`来确定所有必需的依赖并自动安装它们。 `insert_mongodb`可能是库的...

    python mongodb-to-other库源代码

    `mongodb_to_other`库的`setup.py`文件是Python项目的配置脚本,用于安装和打包项目。它定义了项目的基本信息,如版本号、作者信息,以及依赖的外部库,如`pymongo`和`openpyxl`。当用户执行`pip install .`命令时,...

    指压:指压2号机项目

    设置已安装Express-generator和ejs / method-override / mongoose / setup Mongodb数据库/ Google OAuth /在Node.js中打开制作嵌入了自我评估模式的主要用户模式,并引用用户朋友。 接下来,我制作了一个单独的消息...

    Spring整合MongoDB基于Maven

    public void setup() { // 初始化数据,如需 } @After public void tearDown() { // 清理数据,如需 } @Test public void testSaveAndFind() { // 测试保存和查询操作 } } ``` 最后,别忘了在`src/...

    Win10 安装 MongoDB 3.6.5 失败的问题及解决方法

    在Windows 10操作系统上安装MongoDB 3.6.5时,用户可能会遇到一个常见的问题,即安装过程突然终止,出现"MongoDB 3.6.5 2008R2Plus SSL (64 bit) Setup Wizard ended prematurely"的错误提示。这个错误可能让初次...

    PyPI 官网下载 | nameko-mongodb-1.0.1.tar.gz

    为了使用这个库,开发者需要首先解压`nameko-mongodb-1.0.1.tar.gz`,然后在命令行运行`python setup.py install`来安装。之后,就可以在Nameko项目中导入并使用`nameko-mongodb`提供的功能来与MongoDB进行交互了。 ...

    使用Vue3+Koa2+mongoDB开发后台管理系统.zip

    Vue3引入了`<script setup>`语法糖,简化了组件内部的逻辑处理。 - **Composition API**:Vue3的核心变化之一是引入了Composition API,它允许开发者按需组合状态管理和生命周期逻辑,提高了代码组织的灵活性。 - ...

    Python库 | jaraco.mongodb-9.4b5.tar.gz

    4. 配置文件:可能包括setup.py,这是一个Python脚本,用于构建、安装和打包项目。 5. 许可证文件:定义库的使用、复制和分发条件。 在使用jaraco.mongodb时,开发者可能会遇到以下概念和功能: - 连接管理:建立到...

    MongoDB Studio 3t x64 官方最新版本 安装即用

    MongoDB Studio 3t是一款专为MongoDB数据库设计的强大管理工具,尤其适用于x64架构的系统。这个官方最新版本提供了高效、直观的界面,帮助用户轻松管理和操作MongoDB数据库。下面将详细介绍MongoDB Studio 3t的主要...

    mongodb-win-install-script:用于 mongodb 安装的 windows inno 安装脚本

    然而,`mongodb-win-install-script` 提供了一种利用 InnoSetup 创建自定义安装脚本的方法,这使得定制化安装过程变得更加方便,特别是对于系统管理员或者需要批量部署 MongoDB 的情况。 InnoSetup 是一个免费的...

    scrapy-mongodb-queue:Scrapy MongoDB队列

    Scrapy MongoDB队列...$ cd scrapy-mongodb-queue $ python setup.py install用法在您的settings.py启用组件: # Enables scheduling storing requests queue in redis. SCHEDULER = "scrapy_mongodb_queue.schedule

    mongodb-migrations:MongoDB的数据库迁移工具

    $ python setup.py install 如何使用它 创建一个名为migrations的折叠 创建一个名称为TIMESTAMP_description.py的python文件,即20160320145400_description.py ,否则将找不到迁移文件。 在20160320145400_...

    dbunit-mongodb:mongodb 的 dbunit 模块

    public void setUp() { // 初始化 MongoDB 连接和数据集 mongoTemplate = new MongoTemplate(mongoClient, "testDB"); dataSet = new JsonDataSet("testdata.json"); // 加载数据到 MongoDB DatabaseOperation...

Global site tag (gtag.js) - Google Analytics