LoginSignup
0
0

More than 3 years have passed since last update.

mongoDBのインストール手順が変わっていた件

Last updated at Posted at 2020-06-13

mongoDBのインストール

公式ドキュメント
https://docs.mongodb.com/manual/tutorial/install-mongodb-on-os-x/

mongodbがbrewから消えたようなので、代替手順。
【前提】
MacOS
Homebrewインストール済み

Tapのインストール

brew tap mongodb/brew

mongodb-communityのインストール

brew install mongodb-community
...
==> Summary
🍺  /usr/local/Cellar/mongodb-community/4.2.7: 21 files, 306.2MB, built in 4 seconds

ログや接続先の設定ファイル

/usr/local/etc/mongod.conf

コマンド

バージョン確認

mongod --version

バックグラウンドでの起動と停止

起動

brew services start mongodb-community

停止

brew services stop mongodb-community

プロセスの確認

ps aux | grep -v grep | grep mongod

手動で起動

停止したい場合は Ctl+C

mongod --config /usr/local/etc/mongod.conf

コンソール起動

mongo

データベース確認

...
> show dbs
admin   0.000GB
config  0.000GB
local   0.000GB
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0