Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 539 Vote(s) - 3.53 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to start a mongodb service on mac OS X?

#1
I have already installed Mongodb on my mac but the process is currently not running.
How do I start the Mongodb service so that I can start using the commands?
Reply

#2
To start the mongodb, you should only have to run the "mongod" command on the terminal.
Reply

#3
Try the following steps in Terminal:

which mongod

This will output the path to your `mongod`, but if it is not in your `$PATH` the command output will be empty. So you need to find your executable:

find / -name 'mongod'

In the output of this command, you will see many lines, one of which will be like `bin/mongod`, e.g. `/usr/local/mongodb/bin/mongod`. In that case take the whole absolute path and do the following:

echo "PATH=/usr/local/mongodb/bin/:$PATH" >> ~/.bash_profile
. ~/.bash_profile

Then try again:

mongod --dbpath /your/path

Reply

#4
Just go into a folder where you want mongodb to store all the database files and run the command

`mongod --dbpath=.`
Reply

#5
Use this line it will fix the issue.

Execute this line in your terminal at the mongo bin path:

export PATH=<mongodb-install-directory>/bin:$PATH

`<mongodb-install-directory>` replace this with your path, for example:

export PATH=/Application/Mongo/bin:$PATH
Reply

#6
If you used homebrew to install MongoDB on macOS you type the following in terminal. Should do the trick in most cases.

$ brew services start mongodb
Reply

#7
**Install and Run MongoDB with Homebrew**

Open the Terminal app and type

> brew update

After updating Homebrew

> brew install [email protected]

After downloading Mongo, create the “db” directory. This is where the Mongo data files will live.
You can create the directory in the default location by running

> sudo mkdir -p /data/db

Make sure that the /data/db directory has the right permissions by running

> sudo chown -R `id -un` /data/db

Run the Mongo daemon, in one of your terminal windows run

> brew services start mongodb-community

This should start the Mongo server.
Run the Mongo shell, with the Mongo daemon running in one terminal, type **mongo** in another terminal window. This will run the Mongo shell which is an application to access data in MongoDB.
To exit the Mongo shell run quit()
To stop the Mongo daemon hit ctrl-c

start service:

> brew services start mongo

[

[To see links please register here]

][1]


[1]:

[To see links please register here]

Reply

#8
Try with this following steps:

find your MongoDB path and MongoDB database path and run the below command

/Users/username/mongodb/bin/mongod --dbpath=/Users/username/mongodb-data/
Reply

#9
Just do `brew services start mongodb-community`. Example:

$ brew services list
Name Status User Plist
mongodb-community stopped
$ brew services start mongodb-community
==> Successfully started `mongodb-community` (label: homebrew.mxcl.mongodb-community)

Of course, depends on your installation. This is the typical brew install.
Reply

#10
As now is 2021 year, so start `mongodb` on Mac:

# Use `brew`

* `brew services start mongodb-community`
* for installed by: `brew install mongodb-community`

similarly:

## for specify version

* `brew services start [email protected]`
* for installed by: `brew services install [email protected]`

## only running not want bootable

the `start` means **start** and **enable start at launch/boot**

for only run currently, use `run`:

* `brew services run mongodb-community`

## check status

after start, check status use:

* `brew services`


# Manually

for **old version** `mongodb`, the command is `mongod`:

* Directly run: `mongodb`
* Run with config: `mongod --config /usr/local/etc/mongod.conf`
* the default config file path is: `/usr/local/etc/mongod.conf`
* Run with only pass some parameter:
* with database path: `mongod --dbpath /data`
* `/data` is common mongodb database path
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through