MongoDB configuration: error:10061 cannot connect because the target computer is actively rejecting

Source: Internet
Author: User
Tags mongodb server

Believe that many students learn node, when entering the background management Shell MongoDB will "encounter error:10061 because the target computer actively refused, unable to connect" This situation, many cases are The path to DBPath and DBLog is not configured successfully.

Download the installed address, I will not say more http://www.runoob.com/mongodb/mongodb-intro.html to a Chinese version of the installation tutorial, inside the tutorial installation steps, but for window users is really a pit , I installed it for half a day, not this error, that is the Failded to connect.

Obviously, you didn't configure the database file at all,

Create Data Catalog

MongoDB stores the data directory in the DB directory. However, this data directory is not actively created, and we need to create it after the installation is complete. Note that the data directory should be placed under the root directory (e.g. C: \ or D:\. , etc.).

In this tutorial, we've installed MongoDB on the C: disk, now let's create a directory of data and then create the DB directory in the data directory.

C:\>cd C:C:\>mkdir datac:\>cd datac:\data>mkdir DBC :\data>cd DBC:\data\db>         

You can also create these directories through the Windows Explorer, not necessarily through the command line.

Then there is the database.

In order to run the MongoDB server from the command prompt, you must execute the Mongod.exe file from the bin directory of the MongoDB directory mongod --dbpath C:\mongodb\data\ DB


as shown, the server is turned on.

OK, now finally to enter the topic of this article, how to enter the background management of MongoDB
However, do not forget to create a log folder in the data directory to save the journal file.

At this point, finished with, into the MongoDB directory under the Bin directory, and then execute the Mongo.exe file, when you double-click, open a new administrator window can be executed.

One thing to remember is that you must turn on the server to Enter MongoDB manages the shell in the background, and the previous open window cannot be closed.







MongoDB configuration: error:10061 cannot connect because the target computer is actively rejecting

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.