MongoDB basic series-MongoDB server and client Installation

Source: Internet
Author: User
Tags install mongodb mongodb 32 bit mongodb client mongodb server

In the previous blog, I led everyone into the nosql world. If the previous blog is a theory, I would like to show you the true face of mongdb.

MongoDB can be installed on Windows and Linux platforms. Follow these steps to install MongoDB on Windows: 1. Go to the official website to download the corresponding version. Http://www.mongodb.org/downloads Second: Download MongoDB is decompressed version, directly decompress it. It is best to decompress the package to a MongoDB folder because the MongoDB folder will continue to be used below. For example, I decompress the package in the MongoDB folder under the Software Directory: D: \ Software \ MongoDB 3: Set the data file directory: Create a New DB folder anywhere. Note: To facilitate contact with MongoDB, in the previous step, D: \ Software \ MongoDB \ DB 4: Start MongoDB service: mainly use commands in MongoDB, however, you cannot run the EXE file separately like tomcat. You must specify the location of the DB. The listening port number is 27017. Remember this, because later operations require the link port number in the command line: Find the MongoDB location, as shown below:

D: \ Software \ MongoDB \ bin> mongod -- dbpath = D: \ Software \ MongoDB \ DB
D:\software\mongodb\mongodb\bin>mongod --dbpath=D:\software\mongodb\dbSun Jun 02 08:29:10 [initandlisten] MongoDB starting : pid=1584 port=27017 dbpath=D:\software\mongodb\db 32-bit** NOTE: when using MongoDB 32 bit, you are limited to about 2 gigabytes of data**       see http://blog.mongodb.org/post/137788967/32-bit-limitations**       with --dur, the limit is lowerSun Jun 02 08:29:10 [initandlisten] db version v1.8.1, pdfile version 4.5Sun Jun 02 08:29:10 [initandlisten] git version: a429cd4f535b2499cc4130b06ff7c26f41c00f04Sun Jun 02 08:29:10 [initandlisten] build sys info: windows (5, 1, 2600, 2, 'Service Pack 3') BOOST_LIB_VERSION=1_35Sun Jun 02 08:29:10 [initandlisten] waiting for connections on port 27017Sun Jun 02 08:29:10 [websvr] web admin interface listening on port 28017

Fifth, start the mondb service as a Windows service. Therefore, you do not need to perform this operation in Step 4 each time. For later use, you can directly connect to it. Create a directory file such as logs/MongoDB. log to store MongoDB log files. The directory file is in any location. However, it is recommended that the personal location be stored in the MongoDB folder D: \ Software \ MongoDB \ logs \ MongoDB. log operation: In the command line, specify the DB location and log Location D: \ Software \ MongoDB \ bin> mongod -- dbpath = D: \ Software \ MongoDB \ dB -- logpath = D: \ Software \ MongoDB \ logs \ MongoDB. log -- install has been successfully installed in the preceding five steps. You can view the service in the task manager. Note: The MongoDB service has been started in step 4, step 5 is to start mongdb as a Windows service. Then we can test whether the test is successful: This completes. What should we do in the DOS window? Take a look at the simple D: \ Software \ MongoDB \ bin> Mongo

D:\software\mongodb\mongodb\bin>mongoMongoDB shell version: 1.8.1connecting to: test> j={"age":3,"name":"lhy"};{ "age" : 3, "name" : "lhy" }> db.things.save(j);> db.things.find();{ "_id" : ObjectId("51aa9a3fa50650b8898dfbd4"), "age" : 3, "name" : "lhy" }>

Is there any strange feeling that there is no insert statement, but an operation similar to object-oriented language. This is especially true when you execute the SAVE and find methods. Also, I have not created a database. Where can I create a table and store the data? Isn't the memory written into the disk? Well, it's right if you have any questions. By default, the database is "test" and "things". If none of them exist, the database is automatically created. I will explain this in the next blog. If you use the command line to view data is inconvenient, and generally, the database server will develop a corresponding client. For example, the mysql client is navicate, and the common Oracle client is PLSQL. The MongoDB client commonly uses the volume vue.
Download unzip vue: online and cracked version. [If there is no score, contact me separately ]. Because the non-cracked version only has 15 days of use limit. Open the interface as follows: select the link: by default, there are admin and local databases. However, no matter the new database is created by default, the content structure is the same. The results of the DOS test just now are as follows: in the next blog, I will explain how to operate MongoDB databases in Java.

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.