MongoDB - 啟動&串連資料庫

來源:互聯網
上載者:User

標籤:bsp   lin   class   多個   link   而不是   end   資料庫服務   div   

1> 啟動資料庫

  1.1> 依次添加如下目錄:

    1.1.1> mongodb-space

    1.1.2> mongodb-space/conf

    1.1.3> mongodb-space/data

    1.1.4> mongodb-space/log

  1.2> 在 mongodb-space/conf 目錄下添加 global-6969.conf 檔案。

  1.3> 將如下配置寫入 global-6969.conf 檔案中:

port = 6969bind_ip = localhostdbpath = /Users/Morton/mongodb-space/data/global-6969logpath = /Users/Morton/mongodb-space/log/global-6969.loglogappend = truepidfilepath = /Users/Morton/mongodb-space/data/global-6969/global-6969.pidfork = true

    1.3.1> 注意:其中的路徑配置請根據本機環境使用絕對路徑。

  1.4> 執行 mongod -f /Users/Morton/mongodb-space/conf/global-6969.conf 命令,即啟動資料庫。

    1.4.1> 提示:該步驟是建立&啟動 MongoDB 資料庫服務,而不是資料庫,在此服務上可建立多個資料庫。

    1.4.2> 提示:資料檔案存放在 global-6969.conf 檔案 dbpath 項所指定的目錄中。

2> 串連資料庫

  2.1> 執行 mongo localhost:6969/susulink 命令,即串連資料庫,資料庫名為susulink。

 

MongoDB - 啟動&串連資料庫

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.