Windows 10 Installation Mongodb

Source: Internet
Author: User
Tags create mongodb mongodb server mongodb windows new windows 10



Because the new Windows 10 computer, you need to reinstall all the software on the new computer, including MongoDB






download file : Start with the latest version of MongoDB installer on the official website of MongoDB, https://www.mongodb.com/, scroll Web page to try MongoDB for free






Select the Community Server Community version and select the installation version of Windows












installation : Started to try to download the latest version of the 3.6.1 version of the MongoDB website can not enter the installation, because its internal needs to access to Compass-install.exe, if it is a personal computer, I believe there is no problem












No way, can only be used back to the original version 3.4.4 version, installation, and no such problems






Select an installation location, select a selected installation location (C:\MONGODB), after the installation is complete, you can see that the installed file already exists in the directory









You can manually create two empty folders in C:\mongodb



C:\mongodb\data\db



C:\mongodb\log



and create an empty mongo.log below the C:\mongodb\log.









start the server : Run the cmd Command window as Administrator in Win10, and go to the C:\mongodb\bin directory, run the command, which is already running MongoDB server, normal words should have a line of text indicates that the server has been started normally, But my computer did not, do not know what the reason


cd c:\mongodb\bin
mongod --dbpath C:\mongodb\data\db --logpath=C:\mongodb\log\mongodb.log --logappend

 












Connect : Use the cmd Command window and go to the C:\mongodb\bin directory to run the command


Mongo











start MongoDB as a Windows service : The above start-up server is only one-time, when the command window is closed, the server will shut down, you can start MongoDB as windows, so that a boot, MongoDB service has been started


mongod --dbpath C:\mongodb\data\db --logpath=C:\mongodb\log\mongodb.log --logappend --install --serviceName "MongoDB"





or open the browser, enter the address http://localhost:27017, or the http://127.0.0.1:27017






The above screen indicates that MongoDB's Windows service has started smoothly and can then use the command MONGO to connect to the server












use configuration file to start MongoDB service : Create a file mongodb.conf in C:\mongodb\config, adding a configuration file is the same as running the command directly


dbpath = C: \ mongodb \ data \ db # database file
logpath = C: \ mongodb \ log \ mongodb.log # log file
logappend = true # The log is in append mode. After configuration, the mongodb log will be appended to the existing log file.
journal = true # enable journal files, enabled by default
quiet = true # This option can filter out some useless log information. If debugging is needed, please set it to false
port = 27017 # port number default is 27017


Then run the command


 
sc create MongoDB binPath= "C:\mongodb\bin\mongod.exe --service --config=C:\mongodb\config\mongodb.conf"











Remove MongoDB Windows service : If you no longer need MongoDB for Windows services, you can manually turn it on and delete


#You can run this command in any directory
SC Delete MongoDB


or run the following command in the MongoDB bin directory


 
mongod --remove --serviceName "MongoDB"





add MongoDB to the environment variable : At this point into the MongoDB directory can use the MongoDB command-line tool, if in other directories, is not able to use the MongoDB command-line tool, We can add the MongoDB directory to the environment variable, so we can use the MongoDB command-line tool in any location.



Open the Windows Settings window, enter the variables, and click "Edit System Environment variables"









Click Environment variables






Add the MongoDB Bin directory to the PATH environment variable






After adding environment variables, you can use the MongoDB command line tool in any directory.









Use of the MongoDB graphical tool












Reference Document: Win10 under MongoDB installation



Windows 10 Installation Mongodb


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.