forked from docs/doc-exports
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com> Co-authored-by: Wang , Deng Ke <wangdengke2@huawei.com> Co-committed-by: Wang , Deng Ke <wangdengke2@huawei.com>
4.9 KiB
4.9 KiB
How Can I Install a MongoDB Client?
MongoDB official website provides client installation packages for different OSs. Download the official binary installation package at https://www.mongodb.com/download-center#community.
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.
Procedure
- Obtain the installation package.
- Log in at https://www.mongodb.com/download-center#community.
- Choose Server, select RHEL 7.0 Linux 64-bit x64 for OS, and click All version binaries. Figure 1 shows an example.
- Open the downloading page, click linux/mongodb-linux-x86_64-rhel70-3.4.0.tgz to download the binary installation package of MongoDB 3.4.0.
- Upload the installation package to the ECS. For details about how to log in to an ECS, see How Can I Create and Log In to an ECS?
- Decompress the installation package on the ECS.
tar zxvf mongodb-linux-x86_64-rhel70-3.4.0.tgz
- Obtain the client tool from the bin directory of the installation package.
cd mongodb-linux-x86_64-rhel70-3.4.0/bin
The common tools are as follows:
- MongoDB client mongo
- Data export tool mongoexport
- Data import tool mongoimport
- Before using a client tool, assign the execute permission to it.
- Run the chmod +x mongo command to grant a client permission to connect to a DB instance.
- Run the chmod +x mongoexport command to grant a client permission to export data.
- Run the chmod +x mongoimport command to grant a client permission to import data.
- Connect to a DB instance through the installed client.
- For details on how to connect to a cluster instance, see Connecting to a DB Instance Through a Client.
- For details on how to connect to a replica set instance, see Connecting to a DB Instance Through a Client.
Parent topic: Connection and Access FAQs