doc-exports/docs/dds/umn/dds_faq_0018.html
Wang , Deng Ke ba65944bfd Added version 4.2.
Reviewed-by: Boka, Ladislav <ladislav.boka@t-systems.com>
Co-authored-by: Wang , Deng Ke <wangdengke2@huawei.com>
Co-committed-by: Wang , Deng Ke <wangdengke2@huawei.com>
2023-07-11 13:21:20 +00:00

24 lines
5.4 KiB
HTML

<a name="dds_faq_0018"></a><a name="dds_faq_0018"></a>
<h1 class="topictitle1">How Can I Install a MongoDB Client?</h1>
<div id="body8662426"><p id="dds_faq_0018__p6437338416538">MongoDB official website provides client installation packages for different OSs. Download the official binary installation package at <a href="https://www.mongodb.com/download-center#community" target="_blank" rel="noopener noreferrer">https://www.mongodb.com/download-center#community</a>.</p>
<p id="dds_faq_0018__p18375732718">The following uses Red Hat Linux 7 and MongoDB 3.4.0 as examples to describe how to obtain the required installation package and install the MongoDB client.</p>
<div class="section" id="dds_faq_0018__s613b2088cd51405f85d7ff84f71612f4"><h4 class="sectiontitle">Procedure</h4><ol id="dds_faq_0018__o22bb62848f044ba78ddcc8d04b2a2633"><li id="dds_faq_0018__li19040286173627"><span>Obtain the installation package.</span><p><ol type="a" id="dds_faq_0018__ol5149115918032"><li id="dds_faq_0018__li501597610266">Log in at <a href="https://www.mongodb.com/download-center/community" target="_blank" rel="noopener noreferrer">https://www.mongodb.com/download-center/community</a>.</li><li id="dds_faq_0018__li3770190218032">Choose <strong id="dds_faq_0018__b6720121031917">Server</strong>, select <strong id="dds_faq_0018__b20721171011915">RHEL 7.0 Linux 64-bit x64</strong> for <strong id="dds_faq_0018__b1723141061910">OS</strong>, and click <strong id="dds_faq_0018__b57241210191918">All version binaries</strong>. <a href="#dds_faq_0018__fig129943125910">Figure 1</a> shows an example.<div class="fignone" id="dds_faq_0018__fig129943125910"><a name="dds_faq_0018__fig129943125910"></a><a name="fig129943125910"></a><span class="figcap"><b>Figure 1 </b>MongoDB official webpage</span><br><span><img id="dds_faq_0018__image203371024183013" src="en-us_image_0000001096453900.png"></span></div>
</li><li id="dds_faq_0018__li3762697918032">Open the downloading page, click <span class="filepath" id="dds_faq_0018__filepath074313102618"><b>linux/mongodb-linux-x86_64-rhel70-3.4.0.tgz</b></span> to download the binary installation package of MongoDB 3.4.0. <a href="#dds_faq_0018__fig12339163313218">Figure 2</a> shows an example.<div class="fignone" id="dds_faq_0018__fig12339163313218"><a name="dds_faq_0018__fig12339163313218"></a><a name="fig12339163313218"></a><span class="figcap"><b>Figure 2 </b>Downloading page</span><br><span><img id="dds_faq_0018__image18924193033717" src="en-us_image_0000001142893909.png"></span></div>
</li></ol>
</p></li><li id="dds_faq_0018__li1793594932020"><span>Upload the installation package to the <span id="dds_faq_0018__text148221416114916">ECS</span><span id="dds_faq_0018__text817721915493"></span>. For details about how to log in to an <span id="dds_faq_0018__text627532914495">ECS</span><span id="dds_faq_0018__text6275162984915"></span>.</span></li><li id="dds_faq_0018__li12107812234"><span>Decompress the installation package on the <span id="dds_faq_0018__text1721163616498">ECS</span><span id="dds_faq_0018__text9211173674912"></span>.</span><p><p id="dds_faq_0018__p5766646112515"><strong id="dds_faq_0018__b207667460257">tar zxvf mongodb-linux-x86_64-rhel70-3.4.0.tgz</strong></p>
</p></li><li id="dds_faq_0018__li1348614349232"><span>Obtain the client tool from the <span class="filepath" id="dds_faq_0018__filepath10227920908"><b>bin</b></span> directory of the installation package.</span><p><p id="dds_faq_0018__p98325533411"><strong id="dds_faq_0018__b43611193342">cd mongodb-linux-x86_64-rhel70-3.4.0/bin</strong></p>
<p id="dds_faq_0018__p10884134616314">The common tools are as follows:</p>
<ul id="dds_faq_0018__ul6885134623118"><li id="dds_faq_0018__li17885246143114">MongoDB client mongo</li><li id="dds_faq_0018__li1688534620310">Data export tool mongoexport</li><li id="dds_faq_0018__li1388594616316">Data import tool mongoimport</li></ul>
</p></li><li id="dds_faq_0018__li646501155938"><span>Before using a client tool, assign the execute permission to it.</span><p><ul id="dds_faq_0018__ul186071740145218"><li id="dds_faq_0018__li9607174018521">Run the <strong id="dds_faq_0018__b19497131185">chmod +x mongo</strong> command to grant a client permission to connect to a DB instance.</li><li id="dds_faq_0018__li106071540185212">Run the <strong id="dds_faq_0018__b48411643161113">chmod +x mongoexport</strong> command to grant a client permission to export data.</li><li id="dds_faq_0018__li14607164014520">Run the <strong id="dds_faq_0018__b849335410116">chmod +x mongoimport</strong> command to grant a client permission to import data.</li></ul>
</p></li><li id="dds_faq_0018__li16148655171418"><span>Connect to a DB instance through the installed client.</span><p><ul id="dds_faq_0018__ul17445161912155"><li id="dds_faq_0018__li18445191913154">For details on how to connect to a cluster instance, see <a href="en-us_topic_0044018334.html">Connecting to a Cluster Instance Over Private Networks</a>.</li><li id="dds_faq_0018__li596820432293">For details on how to connect to a replica set instance, see <a href="en-us_topic_0105284966.html">Connecting to a Replica Set Instance Over Private Networks</a>.</li><li id="dds_faq_0018__li96205243153">For details on how to connect to a single node instance, see <a href="dds_02_0028.html">Connecting to a Single Node Instance Over Private Networks</a>.</li></ul>
</p></li></ol>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dds_faq_0104.html">Database Connection</a></div>
</div>
</div>