edit-icon download-icon

Mongo shell connection

Last Updated: Jan 17, 2018

Note: ApsaraDB for MongoDB must be accessed using MongoDB Shell 3.0 or later versions; otherwise, authentication fails.

Procedure

  1. Log on to the MongoDB console.

  2. Click an instance ID or View to go to the Basic Information page, as shown in the following figure. Then, obtain the domain name and port number for MongoDB connection.

    Obtain the domain name and port number for MongoDB connection

    Enclosed in red frames are the connection addresses and port numbers of two nodes, which are separated by colons.

  3. On ECS, use the mongo command to establish a connection. A command example is shown as follows.

    1. mongo --host dds-xxxx.mongodb.rds.aliyuncs.com:3717 -u root -p 123456 --authenticationDatabase admin
Thank you! We've received your feedback.