edit-icon download-icon

Mongo shell connection

Last Updated: Jan 17, 2018

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. Locate the target instance, click the instance ID or Manage to go to the Basic Information page, as shown in the following figure. Obtain the domain name and port number for MongoDB connection.

    Obtain the domain name and port number for MongoDB connection

    • The connection address is displayed in the red box 1.

    • The port number is displayed in the red box 2. The connection address and port number are separated by a colon.

  3. In ECS, use the mongo command to establish a connection. A command example is 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.