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?
相关问题
- MongoDB can not create unique sparse index (duplic
- Spring Data MongoDB - lazy access to some fields
- Golang mongodb aggregation
- Xcode debugger displays incorrect values for varia
- Is there a way to report errors in Apple documenta
相关文章
- 现在使用swift开发ios应用好还是swift?
- mongodb有没有什么办法禁止读取数据的时候进行缓存
- mongodb-aggregate聚合查询分组后如何获得多字段
- Visual Studio Code, MAC OS X, OmniSharp server is
- mongodb error: how do I make sure that your journa
- How to track MongoDB requests from a console appli
- xcode 4 garbage collection removed?
- IntelliJ IDEA can't open projects or add SDK o
Just go into a folder where you want mongodb to store all the database files and run the command
mongod --dbpath=.
If you used homebrew to install MongoDB on macOS you type the following in terminal. Should do the trick in most cases.
To start the mongodb, you should only have to run the "mongod" command on the terminal.
Try the following steps in Terminal:
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: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:Then try again:
Use this line it will fix the issue.
Execute this line in your terminal at the mongo bin path:
<mongodb-install-directory>
replace this with your path, for example:For mongodb-community@4.2
To start run brew services start mongodb-community@4.2
To end run brew services stop mongodb-community@4.2