LoginSignup
0
0

More than 5 years have passed since last update.

mongodb的安装和配置

Posted at

安装mongodb

$ brew install mongodb

设置登录时自动开启mongodb

$ ln -sfv /usr/local/opt/mongodb/*.plist ~/Library/LaunchAgents

启动mongodb

$ launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist

无需通过launchctl启动的设置

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

设置完毕后,

$ mongod

便可启动mongodb

进入mongodb

$ mongo

mongo基本操作

> show dbs
> use dbmeizi
> show collections
> db.meizi.find()
> db.dropDatabase()

collection相当于table

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