Install MongoDB under Mac

Source: Internet
Author: User
Tags install mongodb

Install MongoDB under Mac
1. Download mongodb-osx-x86_64-3.4.1.tgz and unzip the Https://www.mongodb.com/download-center on the MongoDB website.
2.
Enter the extracted bin directory

fengnovodemacbook-pro:~ fengnovo$ Cd/users/fengnovo/desktop/mongodb/mongodb-osx-x86_64-3.4.1/bin

Startup Mongod,mongod is the MONGO database server, MONGO is the MONGO database client

fengnovodemacbook-pro:~ fengnovo$ whoamifengnovofengnovodemacbook-pro:~ fengnovo$ sudo-spassword:bash-3.2# whoamirootbash-3.2#./mongod

And then we'll find a report of this mistake.

2016-12-24t22:54:24.079+0800 I STORAGE  [Initandlisten] exception in initandlisten:29 Data directory/data/db not fou nd., terminating

The/data/db path is not, you can create a new path in the System files directory.

MKDIR/DATACD Datamkdir DB

Then try again./mongod, there is no such hint.

3. Open the console window and go to the bin directory just before opening the MONGO client

fengnovodemacbook-pro:~ fengnovo$ whoamifengnovofengnovodemacbook-pro:~ fengnovo$ sudo-spassword:bash-3.2# whoamirootbash-3.2#./mongo

Will find the Mongod Database Server window to print out the following information

2016-12-24t23:02:03.978+0800 I NETWORK  [Thread1] connection accepted from 127.0.0.1:50977 #1 (1 connection now OPEN)

Description There is a database connection request to the MONGO database server
Next, you can happily do the application on MongoDB.

> Show dbsadmin  0.000GBlocal  0.000gb> dbtest

MongoDB Basic Tutorial can view http://www.runoob.com/mongodb/mongodb-connections.html

  

Install MongoDB under Mac

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.