mac下MongoDB数据库安装
生活随笔
收集整理的這篇文章主要介紹了
mac下MongoDB数据库安装
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
MongoDB數(shù)據(jù)庫安裝
下載安裝
https://www.mongodb.com/ 打開官網(wǎng),找到適合自己平臺的包,下載解壓即可解壓安裝后,需要創(chuàng)建一個空的文件夾,用來存放數(shù)據(jù),(我在bin的同級下創(chuàng)建了mongo-data文件夾)
啟動
1.建議把路徑寫入環(huán)境變量,避免路徑過長
2.加入path
$ touch .base_profile$ vim .base_profileexport MONGO_PATH=/usr/local/mongodbexport PATH=$PATH:$MONGO_PATH/bin3.重啟mongodb服務(wù)器,安裝以下方法啟動
mongod --dbpath /存放數(shù)據(jù)的地址4.啟動后控制臺如下(部分)
2017-10-17T11:04:38.472+0800 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=3584M,session_max=20000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),checkpoint=(wait=60,log_size=2GB),statistics_log=(wait=0), 2017-10-17T11:04:39.127+0800 I CONTROL [initandlisten] 2017-10-17T11:04:39.127+0800 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database. 2017-10-17T11:04:39.127+0800 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted. 2017-10-17T11:04:39.127+0800 I CONTROL [initandlisten] 2017-10-17T11:04:39.127+0800 I CONTROL [initandlisten] 2017-10-17T11:04:39.127+0800 I CONTROL [initandlisten] ** WARNING: soft rlimits too low. Number of files is 256, should be at least 1000 2017-10-17T11:04:39.135+0800 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory '/Users/liuhuanwen/Downloads/mongodb/mongo-data/bd/diagnostic.data' 2017-10-17T11:04:39.135+0800 I NETWORK [thread1] waiting for connections on port 27017連接mongodb客戶端
開啟另外一個控制臺,輸入mongo
MongoDB shell version v3.4.9 connecting to: mongodb://127.0.0.1:27017 MongoDB server version: 3.4.9 Server has startup warnings: 2017-10-17T11:04:39.127+0800 I CONTROL [initandlisten] 2017-10-17T11:04:39.127+0800 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database. 2017-10-17T11:04:39.127+0800 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted. 2017-10-17T11:04:39.127+0800 I CONTROL [initandlisten] 2017-10-17T11:04:39.127+0800 I CONTROL [initandlisten] 2017-10-17T11:04:39.127+0800 I CONTROL [initandlisten] ** WARNING: soft rlimits too low. Number of files is 256, should be at least 1000出現(xiàn)以上內(nèi)容就成功連接上mongodb了,接下來就去操作你的數(shù)據(jù)庫吧
轉(zhuǎn)載于:https://www.cnblogs.com/liuhuanwen/p/7680696.html
總結(jié)
以上是生活随笔為你收集整理的mac下MongoDB数据库安装的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: bzoj1025 [SCOI2009]游
- 下一篇: 数据库的ACID特性详解