MongoDB in Windows installation configuration and problems encountered

Source: Internet
Author: User
Tags create mongodb win32

First, installation

1, visit MongoDB's official website http://www.mongodb.org/downloads Download 64bit package, I download is mongodb-win32-x86_ 64-2008plus-ssl-3.4.1-signed.msi

2. Create D:/mongodb

3, click on the package mongodb-win32-x86_64-2008plus-ssl-3.4.1-signed.msi, select Custom mode, customize the selection path to install to D:/mongodb

Second, the configuration

1. Create d:/mongodb/data/db directory (easy to start later)

2, create D:/mongodb/logs, and create Mongodb.log under D:\mongodb\logs (easy to boot, command inside the path can not be wrong)

If you enter the wrong path in the command, prompt at startup:

3, in order to start MongoDB convenient, add Mongod.exe path to environment variable, computer----Advanced system settings----environment variable, add path in path. Add D:\mongodb\bin to the path of the system environment variable

Third, start MongoDB service method

1. Open command Line Input command

CD to the MongoDB installation directory under the Bin, execute the mongod command

Mongod--dbpath "d://mongodb//data//db"--logpath "D://mongodb//logs//mongodb.log"--logappend

Resolution: Mongod

The--dbpath command is the location where the database files are created, and when you start the MongoDB service, you need to determine where the database files are stored, or the system will not be created automatically and the boot will not be successful.

--logpath indicates the path where the log file is stored

--logappend indicates that the log file is written in append mode

Open the browser, enter localhost:27017, and you will see the print it looks like your is trying to access MongoDB over HTTP on the native driver port.

The default 27017 port, you can modify the port through the--port command, such as: Mongod--port 9888 "D:\\mongodb\\data"

2. Start by service mode

Each time you start the service you need to enter the above command, in order to facilitate the start of the database written into the window service way.

After starting CMD as an administrator, enter the command:

SC create MongoDB binpath= "D:\mongodb\bin\mongod.exe--service--dbpath D:\mongodb\data\db--logpath=d:\mongodb\logs\ Mongodb.log--logappend--directoryperdb "

Success marked as hint: CreateService success

Delete Service directive: Mongod.exe--remove--servicename "MongoDB"

Note to start the command line by using administrator mode

So there's MongoDB service in the service.

Start Mongodb:net start MongoDB

Stop Mongodb:net Stop MongoDB

Delete Service command: SC delete MongoDB

Iv. problems encountered

1, in three, the first way to start, encountered the first problem, "Unable to start this program, because the computer lost Api-ms-win-crt-runtime-l1-1-0.dll":

Workaround:

(1) According to the contents of the Baidu Prompt box: Prompt cannot start this program, because the computer lost Api-ms-win-crt-runtime-l1-1-0.dll, see the script home someone also encountered the same problem, the script house provides the corresponding DLL

DLL Access link: http://www.jb51.net/dll/api-ms-win-crt-runtime-l1-1-0.dll.html

(2) After downloading good api-ms-win-crt-runtime-l1-1-0.dll, follow the instructions of the script house above, the Windows XP/WIN7/WIN10 system (64-bit system corresponds to 64-bit DLL file, 32-bit system corresponds to 32-bit DLL file), Copy the Api-ms-win-crt-runtime-l1-1-0.dll to the C:\Windows\System32 directory

(3) Open "Start-run-input regsvr32 api-ms-win-crt-runtime-l1-1-0.dll", enter to solve (many people to this step has been solved, but my computer problems more, this prompt " Unable to locate the program input point ucrtbase.terminate in the dynamic link library ", access to the 2nd question)

2, although in the first step did not solve my computer problem, but also try to start MongoDB using the command, the same hint "unable to locate the program input point ucrtbase.terminate on the dynamic link library Api-ms-win-crt-runtime-l1-1-0.dll"

Baidu has a way to solve: http://jingyan.baidu.com/article/d169e1865acd58436611d83a.html

First determine the specific version of the WINDOWS7 system. Press Win+r at the same time, enter on the command line: Winver.exe, will display your Windows system version, if the system version is Windows 7 with SP1 (that is: 7601:service Pack 1), it is much more convenient, The msvisualc++ 2015 dynamic Library can be installed directly, and the installation package download link is as follows:

: Http://pan.baidu.com/s/1nu7PKLz

Note: 32-bit system please download x86 installation package, 64-bit system please download x64 installation package, download and install can solve the problem.

For users with a system version of 7600, proceed as Step 2.

Because my computer is 64-bit, the direct installation of Msvisualc++ 2015 dynamic Library solves the problem

3, after the first start, the second start

Access server address: http://127.0.0.1:28017, if not accessible, the service actually does not have a real boot.

Depending on the error log, you can determine the cause of this problem, usually because MongoDB stops illegally.

Workaround for this problem: there is a. lock file in the MongoDB installation directory, delete this file to

V. Related information

MongoDB is a database based on distributed file storage. Written by the C + + language. Designed to provide scalable, high-performance data storage solutions for WEB applications.

MongoDB is a product between a relational database and a non-relational database, the most versatile of the non-relational database, the most like the relational database

1, Baidu Encyclopedia: http://baike.baidu.com/link?url= Fmrxwvtuajiky07ffgoalcux6j7cmqc99xl7jjdi-8f7q6t5mien3zfbkk3ptyv87d16i7vdhrpfgl4nvkacy_

2. MongoDB website Address: https://www.mongodb.com/

3. MongoDB official English document: https://docs.mongodb.com/manual/
4. MongoDB Platform: https://www.mongodb.com/download-center#community

MongoDB in Windows installation configuration and problems encountered

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.