Table of Contents
1.初衷
2.下载
Home Database Mysql Tutorial windows中安装mongoDB

windows中安装mongoDB

Jun 07, 2016 pm 04:12 PM
mongodb windows Install this question

1.初衷 这个问题如此简单以至于我想了很久是否应该写一篇文章,不过对于初学者,任何没有接触过的东西都很可能成为一块绊脚石,所以这片博客目的在于记录铺平道路,而不是显示水平。 2.下载 百度或者google搜索'mongodb'关键字,然后找到并打开官网点击打开

1.初衷

这个问题如此简单以至于我想了很久是否应该写一篇文章,不过对于初学者,任何没有接触过的东西都很可能成为一块绊脚石,所以这片博客目的在于记录铺平道路,而不是显示水平。

2.下载

百度或者google搜索'mongodb'关键字,然后找到并打开官网点击打开链接,在右侧点击下载mongodb,截止写本文为止,暂且没有发现64位的windows版本,所以下载时无论点击64位还是32位windows版本都下载的是32位版本,下载msi安装包。另外一个是mongodb native driver 1.x的网址:点击打开链接

3.安装

直接运行安装包,安装到默认路径,应该是C:\Program Files\MongoDB 2.6 Standard的目录。

4.直接启动

运行控制台,cd 到C:\Program Files\MongoDB 2.6 Standard\bin路径,然后运行如下:

>mongod --dbpath D:\MongoDB

注意这个后边跟着的路径应该是全英文的,最好不要出现中文字符

如果要启动mongoDB的shell命令行就运行

>mongo

5.bat启动

每次进入一个C盘的目录通过运行控制台去启动mongoDB,感觉比较麻烦,于是我们可以写一个启动脚本

如下:

C:\"Program Files"\"MongoDB 2.6 Standard"\bin\mongod --dbpath D:\MongoDB\data
pause

值得注意的是启动脚本中不能空格,如果一个目录中有空格,需要用“”将其包括,pause的作用是防止控制台自动关闭。而且这里的路径都是绝对路径

同样启动mongo shell也可以写一个bat文件,如下:

C:\"Program Files"\"MongoDB 2.6 Standard"\bin\mongo
pause

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1664
14
PHP Tutorial
1267
29
C# Tutorial
1239
24
Use Composer to solve the dilemma of recommendation systems: andres-montanez/recommendations-bundle Use Composer to solve the dilemma of recommendation systems: andres-montanez/recommendations-bundle Apr 18, 2025 am 11:48 AM

When developing an e-commerce website, I encountered a difficult problem: how to provide users with personalized product recommendations. Initially, I tried some simple recommendation algorithms, but the results were not ideal, and user satisfaction was also affected. In order to improve the accuracy and efficiency of the recommendation system, I decided to adopt a more professional solution. Finally, I installed andres-montanez/recommendations-bundle through Composer, which not only solved my problem, but also greatly improved the performance of the recommendation system. You can learn composer through the following address:

Can vs code run in Windows 8 Can vs code run in Windows 8 Apr 15, 2025 pm 07:24 PM

VS Code can run on Windows 8, but the experience may not be great. First make sure the system has been updated to the latest patch, then download the VS Code installation package that matches the system architecture and install it as prompted. After installation, be aware that some extensions may be incompatible with Windows 8 and need to look for alternative extensions or use newer Windows systems in a virtual machine. Install the necessary extensions to check whether they work properly. Although VS Code is feasible on Windows 8, it is recommended to upgrade to a newer Windows system for a better development experience and security.

How to solve complex BelongsToThrough relationship problem in Laravel? Use Composer! How to solve complex BelongsToThrough relationship problem in Laravel? Use Composer! Apr 17, 2025 pm 09:54 PM

In Laravel development, dealing with complex model relationships has always been a challenge, especially when it comes to multi-level BelongsToThrough relationships. Recently, I encountered this problem in a project dealing with a multi-level model relationship, where traditional HasManyThrough relationships fail to meet the needs, resulting in data queries becoming complex and inefficient. After some exploration, I found the library staudenmeir/belongs-to-through, which easily installed and solved my troubles through Composer.

How to run sublime after writing the code How to run sublime after writing the code Apr 16, 2025 am 08:51 AM

There are six ways to run code in Sublime: through hotkeys, menus, build systems, command lines, set default build systems, and custom build commands, and run individual files/projects by right-clicking on projects/files. The build system availability depends on the installation of Sublime Text.

vscode cannot install extension vscode cannot install extension Apr 15, 2025 pm 07:18 PM

The reasons for the installation of VS Code extensions may be: network instability, insufficient permissions, system compatibility issues, VS Code version is too old, antivirus software or firewall interference. By checking network connections, permissions, log files, updating VS Code, disabling security software, and restarting VS Code or computers, you can gradually troubleshoot and resolve issues.

laravel installation code laravel installation code Apr 18, 2025 pm 12:30 PM

To install Laravel, follow these steps in sequence: Install Composer (for macOS/Linux and Windows) Install Laravel Installer Create a new project Start Service Access Application (URL: http://127.0.0.1:8000) Set up the database connection (if required)

git software installation git software installation Apr 17, 2025 am 11:57 AM

Installing Git software includes the following steps: Download the installation package and run the installation package to verify the installation configuration Git installation Git Bash (Windows only)

Can vscode be used for mac Can vscode be used for mac Apr 15, 2025 pm 07:36 PM

VS Code is available on Mac. It has powerful extensions, Git integration, terminal and debugger, and also offers a wealth of setup options. However, for particularly large projects or highly professional development, VS Code may have performance or functional limitations.

See all articles