You can install the mongo shell on an ECS instance and use the mongo shell to connect to ApsaraDB for MongoDB.
To ensure successful authentication, use mongo shell 3.0 or a later version to connect to ApsaraDB for MongoDB.
- Log on to the ApsaraDB for MongoDB console.
- Click the target instance ID or choose Basic Information page of the target instance. in the Operation column to go to the
- In the left-side navigation pane, click Database Connection.
- Red boxes highlight the connection information.
- In each connection address, the default port number is 3717 and the domain name is separated from the port number with a colon (:).
- In the ECS instance, run a mongo command to connect to ApsaraDB for MongoDB. The following command is an example:
mongo --host dds-xxxx.mongodb.rds.aliyuncs.com:3717 -u root -p Ft123456 --authenticationDatabase admin
Mongo shell FAQs