日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

mac下MongoDB数据库安装

發布時間:2025/5/22 25 豆豆
生活随笔 收集整理的這篇文章主要介紹了 mac下MongoDB数据库安装 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

MongoDB數據庫安裝

下載安裝

https://www.mongodb.com/ 打開官網,找到適合自己平臺的包,下載解壓即可

解壓安裝后,需要創建一個空的文件夾,用來存放數據,(我在bin的同級下創建了mongo-data文件夾)

啟動

1.建議把路徑寫入環境變量,避免路徑過長

2.加入path

$ touch .base_profile$ vim .base_profileexport MONGO_PATH=/usr/local/mongodbexport PATH=$PATH:$MONGO_PATH/bin

3.重啟mongodb服務器,安裝以下方法啟動

mongod --dbpath /存放數據的地址

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

出現以上內容就成功連接上mongodb了,接下來就去操作你的數據庫吧

轉載于:https://www.cnblogs.com/liuhuanwen/p/7680696.html

總結

以上是生活随笔為你收集整理的mac下MongoDB数据库安装的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。