MongoDB Windows-Free installation

Source: Internet
Author: User
Tags mongodb server mongodb windows

The normal way to visit MongoDB's official website, which provides only the download of the MSI installation package, has the advantage of being directly managed as a Windows service.

In some cases, however, we want to not install as a service for Windows, such as limited by the company's IT security policy, which is not available to us, and in this case we would like to be able to use MongoDB in a no-install way.

Operation Method:

1, visit the list of documents provided on the MONGODB official website

Https://www.mongodb.org/dl/win32

2, this list provides a lot of Windows version, which also includes whether to support the version of SSL, according to their own needs to choose the corresponding version download, and extract to the desired directory

3, set up MongoDB data storage directory, such as D:\tryout\mongodb\data

4. Start MongoDB Service:

Go to CMD prompt console, execute $mongodb\bin\mongod.exe--dbpath=d:\tryout\mongodb\data

If successful, you will be prompted with a message similar to the following:

2017-05-23t17:05:52.814+0800 I CONTROL [Initandlisten] MongoDB starting:pid=9
368 port=27017 dbpath=d:\tryout\mongodb\data 64-bit host=ssc1-w440
2017-05-23t17:05:52.815+0800 I CONTROL [Initandlisten] targetminos:windows Vis
Ta/windows Server 2008
2017-05-23t17:05:52.815+0800 I CONTROL [initandlisten] DB version V3.4.5-rc1
2017-05-23t17:05:52.815+0800 I CONTROL [Initandlisten] git version:a3874e7dfb6
E3012098c843a1cd05735ee36aab3
2017-05-23t17:05:52.816+0800 I CONTROL [Initandlisten] Allocator:tcmalloc
2017-05-23t17:05:52.816+0800 I CONTROL [Initandlisten] Modules:none
2017-05-23t17:05:52.817+0800 I CONTROL [Initandlisten] Build environment:
2017-05-23t17:05:52.817+0800 I CONTROL [Initandlisten] distarch:x86_64
2017-05-23t17:05:52.817+0800 I CONTROL [Initandlisten] target_arch:x86_64
2017-05-23t17:05:52.818+0800 I CONTROL [Initandlisten] options: {storage: {db
Path: "D:\tryout\mongodb\data"}}
2017-05-23t17:05:52.819+0800 I-[Initandlisten] detected data files in D
: \tryout\mongodb\data created by the ' Wiredtiger ' storage engine, so setting the
Active storage engine to ' Wiredtiger '.
2017-05-23t17:05:52.819+0800 I STORAGE [initandlisten] wiredtiger_open config:
Create,cache_size=3427m,session_max=20000,eviction= (threads_min=4,threads_max=4)
, config_base=false,statistics= (FAST), log= (enabled=true,archive=true,path=journal
, Compressor=snappy), file_manager= (close_idle_time=100000), checkpoint= (Wait=60,lo
G_SIZE=2GB), statistics_log= (wait=0),
2017-05-23t17:05:53.497+0800 I CONTROL [Initandlisten]
2017-05-23t17:05:53.498+0800 I CONTROL [initandlisten] * * warning:access CONTR
OL is not enabled for the database.
2017-05-23t17:05:53.498+0800 I CONTROL [initandlisten] * * Read and WRI
Te access to data and configuration is unrestricted.
2017-05-23t17:05:53.499+0800 I CONTROL [Initandlisten]
2017-05-23t17:05:53.499+0800 I CONTROL [Initandlisten] Hotfix KB2731284 or late
R Update is not installed, would zero-out data files.
2017-05-23t17:05:53.500+0800 I CONTROL [Initandlisten]
2017-05-23t17:05:54.608+0800 I ftdc [Initandlisten] Initializing full-time D
Iagnostic data capture with directory ' D:/tryout/mongodb/data/diagnostic.data '
2017-05-23t17:05:54.610+0800 I NETWORK [thread1] waiting for connections on por
T 27017
2017-05-23t17:05:54.782+0800 I NETWORK [Thread1] connection accepted from 127.0
.0.1:58806 #1 (1 connection now OPEN)

5. Use client connection to MONGODB database

Open another CMD window to execute $mongodb\bin\mongo.exe

If the connection is successful, you will be prompted with information similar to the following:

$./mongo.exe
MongoDB Shell version V3.4.5-rc1
Connecting to:mongodb://127.0.0.1:27017
MongoDB Server Version:3.4.5-rc1

6, the default database is test, in the code can be accessed by the following URI mongodb://localhost:27017/test

MongoDB Windows-Free installation

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.